Module: Arena::Configurable

Included in:
Arena, Arena::Cache::Adaptor::Generic, Client
Defined in:
lib/arena/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_token=(value) ⇒ Object (writeonly)

Sets the attribute access_token

Parameters:

  • value

    the value to set the attribute access_token to.



8
9
10
# File 'lib/arena/configurable.rb', line 8

def access_token=(value)
  @access_token = value
end

#api_versionObject

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

Parameters:

  • value

    the value to set the attribute application_id to.



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

Parameters:

  • value

    the value to set the attribute application_secret to.



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

Parameters:

  • value

    the value to set the attribute auth_token to.



8
9
10
# File 'lib/arena/configurable.rb', line 8

def auth_token=(value)
  @auth_token = value
end

#base_domainObject

Returns the value of attribute base_domain.



3
4
5
# File 'lib/arena/configurable.rb', line 3

def base_domain
  @base_domain
end

#expires_inObject

Returns the value of attribute expires_in.



3
4
5
# File 'lib/arena/configurable.rb', line 3

def expires_in
  @expires_in
end

#use_cachingObject

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

.keysObject



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

Yields:

  • (_self)

Yield Parameters:



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.options[key])
  end
  
  self
end