Module: EmpireAvenue::Configurable
- Extended by:
- Forwardable
- Included in:
- EmpireAvenue, Client
- Defined in:
- lib/empireavenue/configurable.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#identity_map ⇒ Object
Returns the value of attribute identity_map.
-
#middleware ⇒ Object
Returns the value of attribute middleware.
-
#oauth_token ⇒ Object
Returns the value of attribute oauth_token.
-
#oauth_token_secret ⇒ Object
Returns the value of attribute oauth_token_secret.
Class Method Summary collapse
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block.
- #credentials? ⇒ Boolean
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
7 8 9 |
# File 'lib/empireavenue/configurable.rb', line 7 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
7 8 9 |
# File 'lib/empireavenue/configurable.rb', line 7 def client_secret @client_secret end |
#connection_options ⇒ Object
Returns the value of attribute connection_options.
8 9 10 |
# File 'lib/empireavenue/configurable.rb', line 8 def @connection_options end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
8 9 10 |
# File 'lib/empireavenue/configurable.rb', line 8 def endpoint @endpoint end |
#identity_map ⇒ Object
Returns the value of attribute identity_map.
8 9 10 |
# File 'lib/empireavenue/configurable.rb', line 8 def identity_map @identity_map end |
#middleware ⇒ Object
Returns the value of attribute middleware.
8 9 10 |
# File 'lib/empireavenue/configurable.rb', line 8 def middleware @middleware end |
#oauth_token ⇒ Object
Returns the value of attribute oauth_token.
7 8 9 |
# File 'lib/empireavenue/configurable.rb', line 7 def oauth_token @oauth_token end |
#oauth_token_secret ⇒ Object
Returns the value of attribute oauth_token_secret.
7 8 9 |
# File 'lib/empireavenue/configurable.rb', line 7 def oauth_token_secret @oauth_token_secret end |
Class Method Details
.keys ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/empireavenue/configurable.rb', line 13 def keys @keys ||= [ :client_id, :client_secret, :oauth_token, :oauth_token_secret, :endpoint, :connection_options, :identity_map, :middleware, ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
32 33 34 35 36 |
# File 'lib/empireavenue/configurable.rb', line 32 def configure yield self validate_credential_type! self end |
#credentials? ⇒ Boolean
39 40 41 |
# File 'lib/empireavenue/configurable.rb', line 39 def credentials? credentials.values.all? end |
#reset! ⇒ Object Also known as: setup
43 44 45 46 47 48 |
# File 'lib/empireavenue/configurable.rb', line 43 def reset! EmpireAvenue::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", EmpireAvenue::Default.[key]) end self end |