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(h) ⇒ 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.
45 46 47 48 |
# File 'lib/redox.rb', line 45 def initialize @api_key = nil @secret = nil end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
43 44 45 |
# File 'lib/redox.rb', line 43 def api_key @api_key end |
#secret ⇒ Object
Returns the value of attribute secret.
43 44 45 |
# File 'lib/redox.rb', line 43 def secret @secret end |
Instance Method Details
#api_endpoint ⇒ Object
54 55 56 |
# File 'lib/redox.rb', line 54 def api_endpoint return Connection.base_uri end |
#api_endpoint=(endpoint) ⇒ Object
50 51 52 |
# File 'lib/redox.rb', line 50 def api_endpoint=(endpoint) Connection.base_uri(endpoint.freeze) end |
#from_h(h) ⇒ Object
75 76 77 78 79 80 81 82 |
# File 'lib/redox.rb', line 75 def from_h(h) self.api_key = h[:api_key] self.secret = h[:secret] self.api_endpoint = h[:api_endpoint] self.token_expiry_padding = h[:token_expiry_padding] return self end |
#to_h ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/redox.rb', line 66 def to_h return { api_key: @api_key, secret: @secret, api_endpoint: api_endpoint, token_expiry_padding: token_expiry_padding } end |
#token_expiry_padding ⇒ Object
62 63 64 |
# File 'lib/redox.rb', line 62 def token_expiry_padding return Authentication.token_expiry_padding end |
#token_expiry_padding=(time_in_seconds) ⇒ Object
58 59 60 |
# File 'lib/redox.rb', line 58 def token_expiry_padding=(time_in_seconds) Authentication.token_expiry_padding = time_in_seconds end |