Class: LightspeedRestaurantClient::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/lightspeed_restaurant/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_token, base_uri) ⇒ Configuration

Returns a new instance of Configuration.



7
8
9
10
# File 'lib/lightspeed_restaurant/configuration.rb', line 7

def initialize(api_token, base_uri)
  @api_token = api_token
  @base_uri = base_uri
end

Instance Attribute Details

#api_tokenObject (readonly)

Returns the value of attribute api_token.



5
6
7
# File 'lib/lightspeed_restaurant/configuration.rb', line 5

def api_token
  @api_token
end

#base_uriObject (readonly)

Returns the value of attribute base_uri.



5
6
7
# File 'lib/lightspeed_restaurant/configuration.rb', line 5

def base_uri
  @base_uri
end

Instance Method Details

#with(attributes) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/lightspeed_restaurant/configuration.rb', line 12

def with(attributes)
  attributes_with_string_keys = {}
  attributes.dup.each_pair do |name, value|
    attributes_with_string_keys[name.to_s] = value
  end
  self.class.new(
    attributes_with_string_keys.fetch('api_token', api_token),
    attributes_with_string_keys.fetch('base_uri', base_uri)
  )
end