Module: Fortnox::Configurable
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#authorization_code ⇒ Object
Returns the value of attribute authorization_code.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #options ⇒ Object
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/fortnox/configurable.rb', line 4 def access_token @access_token end |
#authorization_code ⇒ Object
Returns the value of attribute authorization_code.
4 5 6 |
# File 'lib/fortnox/configurable.rb', line 4 def @authorization_code end |
#client_id ⇒ Object
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/fortnox/configurable.rb', line 4 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
4 5 6 |
# File 'lib/fortnox/configurable.rb', line 4 def client_secret @client_secret end |
Class Method Details
.keys ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/fortnox/configurable.rb', line 7 def keys @keys ||= [ :client_id, :access_token, :client_secret, :authorization_code ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
17 18 19 |
# File 'lib/fortnox/configurable.rb', line 17 def configure yield self end |
#options ⇒ Object
28 29 30 |
# File 'lib/fortnox/configurable.rb', line 28 def Hash[Fortnox::Configurable.keys.map{|key| [key, instance_variable_get(:"@#{key}")]}] end |
#reset! ⇒ Object Also known as: setup
21 22 23 24 25 |
# File 'lib/fortnox/configurable.rb', line 21 def reset! Fortnox::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Fortnox::Default.[key]) end end |