Class: Numerics::KeySet
- Inherits:
-
Object
- Object
- Numerics::KeySet
- Defined in:
- lib/numerics/configuration.rb
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
Instance Method Summary collapse
-
#initialize(keys) ⇒ KeySet
constructor
A new instance of KeySet.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(keys) ⇒ KeySet
Returns a new instance of KeySet.
9 10 11 12 |
# File 'lib/numerics/configuration.rb', line 9 def initialize(keys) @access_key = keys[:access_key] || keys['access_key'] || keys[:key] || keys['key'] @secret_key = keys[:secret_key] || keys['secret_key'] || keys[:secret] || keys['secret'] end |
Instance Attribute Details
#access_key ⇒ Object
Returns the value of attribute access_key.
7 8 9 |
# File 'lib/numerics/configuration.rb', line 7 def access_key @access_key end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
7 8 9 |
# File 'lib/numerics/configuration.rb', line 7 def secret_key @secret_key end |
Instance Method Details
#to_hash ⇒ Object
14 15 16 |
# File 'lib/numerics/configuration.rb', line 14 def to_hash {:access_key => @access_key, :secret_key => @secret_key} end |
#to_json ⇒ Object
18 19 20 |
# File 'lib/numerics/configuration.rb', line 18 def to_json Yajl::Encoder.encode(self.to_hash) end |