Module: BaseApi::Configurable

Included in:
BaseApi, Client
Defined in:
lib/base_api/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



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

def access_token
  @access_token
end

#client_idObject

Returns the value of attribute client_id.



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

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



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

def client_secret
  @client_secret
end

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

#limitObject

Returns the value of attribute limit.



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

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset.



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

def offset
  @offset
end

#redirect_uriObject

Returns the value of attribute redirect_uri.



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

def redirect_uri
  @redirect_uri
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



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

def refresh_token
  @refresh_token
end

Class Method Details

.keysObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/base_api/configurable.rb', line 7

def keys
  @keys ||= [
    :client_id,
    :client_secret,
    :code,
    :access_token,
    :refresh_token,
    :limit,
    :offset,
    :redirect_uri
  ]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



21
22
23
# File 'lib/base_api/configurable.rb', line 21

def configure
  yield self
end

#reset!Object

Reset configuration options to default values



26
27
28
29
30
31
# File 'lib/base_api/configurable.rb', line 26

def reset!
  BaseApi::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", BaseApi::Default.options[key])
  end
  self
end