Module: BaseApi::Configurable
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#code ⇒ Object
Returns the value of attribute code.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#reset! ⇒ Object
Reset configuration options to default values.
Instance Attribute Details
#access_token ⇒ Object
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_id ⇒ Object
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_secret ⇒ Object
Returns the value of attribute client_secret.
3 4 5 |
# File 'lib/base_api/configurable.rb', line 3 def client_secret @client_secret end |
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/base_api/configurable.rb', line 3 def code @code end |
#limit ⇒ Object
Returns the value of attribute limit.
3 4 5 |
# File 'lib/base_api/configurable.rb', line 3 def limit @limit end |
#offset ⇒ Object
Returns the value of attribute offset.
3 4 5 |
# File 'lib/base_api/configurable.rb', line 3 def offset @offset end |
#redirect_uri ⇒ Object
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_token ⇒ Object
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
.keys ⇒ Object
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
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.[key]) end self end |