Module: Arena::Configurable
- Included in:
- Arena, Arena::Cache::Adaptor::Generic, Client
- Defined in:
- lib/arena/configurable.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
writeonly
Sets the attribute access_token.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#application_id ⇒ Object
writeonly
Sets the attribute application_id.
-
#application_secret ⇒ Object
writeonly
Sets the attribute application_secret.
-
#auth_token ⇒ Object
writeonly
Sets the attribute auth_token.
-
#base_domain ⇒ Object
Returns the value of attribute base_domain.
-
#expires_in ⇒ Object
Returns the value of attribute expires_in.
-
#use_caching ⇒ Object
Returns the value of attribute use_caching.
Class Method Summary collapse
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Allows configuration options to be set in a block.
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#access_token=(value) ⇒ Object (writeonly)
Sets the attribute access_token
10 11 12 |
# File 'lib/arena/configurable.rb', line 10 def access_token=(value) @access_token = value end |
#api_version ⇒ Object
Returns the value of attribute api_version.
5 6 7 |
# File 'lib/arena/configurable.rb', line 5 def api_version @api_version end |
#application_id=(value) ⇒ Object (writeonly)
Sets the attribute application_id
10 11 12 |
# File 'lib/arena/configurable.rb', line 10 def application_id=(value) @application_id = value end |
#application_secret=(value) ⇒ Object (writeonly)
Sets the attribute application_secret
10 11 12 |
# File 'lib/arena/configurable.rb', line 10 def application_secret=(value) @application_secret = value end |
#auth_token=(value) ⇒ Object (writeonly)
Sets the attribute auth_token
10 11 12 |
# File 'lib/arena/configurable.rb', line 10 def auth_token=(value) @auth_token = value end |
#base_domain ⇒ Object
Returns the value of attribute base_domain.
5 6 7 |
# File 'lib/arena/configurable.rb', line 5 def base_domain @base_domain end |
#expires_in ⇒ Object
Returns the value of attribute expires_in.
5 6 7 |
# File 'lib/arena/configurable.rb', line 5 def expires_in @expires_in end |
#use_caching ⇒ Object
Returns the value of attribute use_caching.
5 6 7 |
# File 'lib/arena/configurable.rb', line 5 def use_caching @use_caching end |
Class Method Details
.keys ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/arena/configurable.rb', line 16 def keys @keys ||= %i[ base_domain api_version application_id application_secret access_token auth_token use_caching expires_in ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Allows configuration options to be set in a block
32 33 34 35 36 |
# File 'lib/arena/configurable.rb', line 32 def configure yield self self end |
#reset! ⇒ Object Also known as: setup
38 39 40 41 42 43 44 |
# File 'lib/arena/configurable.rb', line 38 def reset! Arena::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Arena::Default.[key]) end self end |