Class: Redox::Configuration
- Inherits:
-
Object
- Object
- Redox::Configuration
- Defined in:
- lib/redox.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
- #api_endpoint ⇒ Object
- #api_endpoint=(endpoint) ⇒ Object
- #from_h(init_hash) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
- #token_expiry_padding ⇒ Object
- #token_expiry_padding=(time_in_seconds) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
48 49 50 51 |
# File 'lib/redox.rb', line 48 def initialize @api_key = nil @secret = nil end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
46 47 48 |
# File 'lib/redox.rb', line 46 def api_key @api_key end |
#secret ⇒ Object
Returns the value of attribute secret.
46 47 48 |
# File 'lib/redox.rb', line 46 def secret @secret end |
Instance Method Details
#api_endpoint ⇒ Object
57 58 59 |
# File 'lib/redox.rb', line 57 def api_endpoint Connection.base_uri end |
#api_endpoint=(endpoint) ⇒ Object
53 54 55 |
# File 'lib/redox.rb', line 53 def api_endpoint=(endpoint) Connection.base_uri(endpoint.freeze) end |
#from_h(init_hash) ⇒ Object
78 79 80 81 82 83 84 85 |
# File 'lib/redox.rb', line 78 def from_h(init_hash) self.api_key = init_hash[:api_key] self.secret = init_hash[:secret] self.api_endpoint = init_hash[:api_endpoint] self.token_expiry_padding = init_hash[:token_expiry_padding] self end |
#to_h ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/redox.rb', line 69 def to_h { api_key: @api_key, secret: @secret, api_endpoint: api_endpoint, token_expiry_padding: token_expiry_padding } end |
#token_expiry_padding ⇒ Object
65 66 67 |
# File 'lib/redox.rb', line 65 def token_expiry_padding Authentication.token_expiry_padding end |
#token_expiry_padding=(time_in_seconds) ⇒ Object
61 62 63 |
# File 'lib/redox.rb', line 61 def token_expiry_padding=(time_in_seconds) Authentication.token_expiry_padding = time_in_seconds end |