Class: BookingSync::Engine::ApplicationCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/bookingsync/engine/application_credentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application = nil) ⇒ ApplicationCredentials

Returns a new instance of ApplicationCredentials.


5
6
7
8
9
10
# File 'lib/bookingsync/engine/application_credentials.rb', line 5

def initialize(application = nil)
  if application.present?
    @client_id = application.client_id
    @client_secret = application.client_secret
  end
end

Instance Attribute Details

#client_idObject (readonly)

Returns the value of attribute client_id.


2
3
4
# File 'lib/bookingsync/engine/application_credentials.rb', line 2

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.


3
4
5
# File 'lib/bookingsync/engine/application_credentials.rb', line 3

def client_secret
  @client_secret
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/bookingsync/engine/application_credentials.rb', line 12

def valid?
  client_id.present? && client_secret.present?
end