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.



10
11
12
# File 'lib/arena/configurable.rb', line 10

def access_token=(value)
  @access_token = value
end

#api_versionObject

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

Parameters:

  • value

    the value to set the attribute application_id to.



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

Parameters:

  • value

    the value to set the attribute application_secret to.



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

Parameters:

  • value

    the value to set the attribute auth_token to.



10
11
12
# File 'lib/arena/configurable.rb', line 10

def auth_token=(value)
  @auth_token = value
end

#base_domainObject

Returns the value of attribute base_domain.



5
6
7
# File 'lib/arena/configurable.rb', line 5

def base_domain
  @base_domain
end

#expires_inObject

Returns the value of attribute expires_in.



5
6
7
# File 'lib/arena/configurable.rb', line 5

def expires_in
  @expires_in
end

#use_cachingObject

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

.keysObject



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

Yields:

  • (_self)

Yield Parameters:



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

  self
end