Module: ArmoryApi::Configurable
- Defined in:
- lib/armory_api/configurable.rb
Instance Attribute Summary collapse
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#middleware ⇒ Object
Returns the value of attribute middleware.
-
#region ⇒ Object
Returns the value of attribute region.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#connection_options ⇒ Object
Returns the value of attribute connection_options.
6 7 8 |
# File 'lib/armory_api/configurable.rb', line 6 def @connection_options end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
6 7 8 |
# File 'lib/armory_api/configurable.rb', line 6 def endpoint @endpoint end |
#locale ⇒ Object
Returns the value of attribute locale.
6 7 8 |
# File 'lib/armory_api/configurable.rb', line 6 def locale @locale end |
#middleware ⇒ Object
Returns the value of attribute middleware.
6 7 8 |
# File 'lib/armory_api/configurable.rb', line 6 def middleware @middleware end |
#region ⇒ Object
Returns the value of attribute region.
6 7 8 |
# File 'lib/armory_api/configurable.rb', line 6 def region @region end |
Class Method Details
.keys ⇒ Object
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
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.[k]) end self end |