Module: ArmoryApi::Configurable

Defined in:
lib/armory_api/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connection_optionsObject

Returns the value of attribute connection_options.



6
7
8
# File 'lib/armory_api/configurable.rb', line 6

def connection_options
  @connection_options
end

#endpointObject

Returns the value of attribute endpoint.



6
7
8
# File 'lib/armory_api/configurable.rb', line 6

def endpoint
  @endpoint
end

#localeObject

Returns the value of attribute locale.



6
7
8
# File 'lib/armory_api/configurable.rb', line 6

def locale
  @locale
end

#middlewareObject

Returns the value of attribute middleware.



6
7
8
# File 'lib/armory_api/configurable.rb', line 6

def middleware
  @middleware
end

#regionObject

Returns the value of attribute region.



6
7
8
# File 'lib/armory_api/configurable.rb', line 6

def region
  @region
end

Class Method Details

.keysObject



10
11
12
13
14
15
16
17
# File 'lib/armory_api/configurable.rb', line 10

def keys
  @keys ||= [
    :region,
    :locale,
    :connection_options,
    :middleware
  ]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



20
21
22
23
# File 'lib/armory_api/configurable.rb', line 20

def configure
  yield self
  self
end

#reset!Object Also known as: setup



25
26
27
28
29
30
# File 'lib/armory_api/configurable.rb', line 25

def reset!
  ArmoryApi::Configurable.keys.each do |k|
    instance_variable_set(:"@#{k}", ArmoryApi::Default.options[k])
  end
  self
end