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
8 9 10 |
# File 'lib/arena/configurable.rb', line 8 def access_token=(value) @access_token = value end |
#api_version ⇒ Object
Returns the value of attribute api_version.
3 4 5 |
# File 'lib/arena/configurable.rb', line 3 def api_version @api_version end |
#application_id=(value) ⇒ Object (writeonly)
Sets the attribute application_id
8 9 10 |
# File 'lib/arena/configurable.rb', line 8 def application_id=(value) @application_id = value end |
#application_secret=(value) ⇒ Object (writeonly)
Sets the attribute application_secret
8 9 10 |
# File 'lib/arena/configurable.rb', line 8 def application_secret=(value) @application_secret = value end |
#auth_token=(value) ⇒ Object (writeonly)
Sets the attribute auth_token
8 9 10 |
# File 'lib/arena/configurable.rb', line 8 def auth_token=(value) @auth_token = value end |
#base_domain ⇒ Object
Returns the value of attribute base_domain.
3 4 5 |
# File 'lib/arena/configurable.rb', line 3 def base_domain @base_domain end |
#expires_in ⇒ Object
Returns the value of attribute expires_in.
3 4 5 |
# File 'lib/arena/configurable.rb', line 3 def expires_in @expires_in end |
#use_caching ⇒ Object
Returns the value of attribute use_caching.
3 4 5 |
# File 'lib/arena/configurable.rb', line 3 def use_caching @use_caching end |
Class Method Details
.keys ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/arena/configurable.rb', line 14 def keys @keys ||= [ :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
30 31 32 33 34 |
# File 'lib/arena/configurable.rb', line 30 def configure yield self self end |
#reset! ⇒ Object Also known as: setup
36 37 38 39 40 41 42 |
# File 'lib/arena/configurable.rb', line 36 def reset! Arena::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Arena::Default.[key]) end self end |