Class: BillerBotResource::Configuration
- Inherits:
-
Object
- Object
- BillerBotResource::Configuration
- Defined in:
- lib/biller_bot_resource/configuration.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#site ⇒ Object
Returns the value of attribute site.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
- #api_key ⇒ Object
-
#api_key=(key) ⇒ Object
We store the API key within the context of the thread because this is more likely to change between requests.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
4 5 6 7 |
# File 'lib/biller_bot_resource/configuration.rb', line 4 def initialize self.site = "https://billerbot.com" self.timeout = 7 # seconds. Low value so we fail fast end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
2 3 4 |
# File 'lib/biller_bot_resource/configuration.rb', line 2 def logger @logger end |
#site ⇒ Object
Returns the value of attribute site.
2 3 4 |
# File 'lib/biller_bot_resource/configuration.rb', line 2 def site @site end |
#timeout ⇒ Object
Returns the value of attribute timeout.
2 3 4 |
# File 'lib/biller_bot_resource/configuration.rb', line 2 def timeout @timeout end |
Instance Method Details
#api_key ⇒ Object
16 17 18 |
# File 'lib/biller_bot_resource/configuration.rb', line 16 def api_key Thread.current["active.resource.currentthread.api_key"] end |
#api_key=(key) ⇒ Object
We store the API key within the context of the thread because this is more likely to change between requests.
12 13 14 |
# File 'lib/biller_bot_resource/configuration.rb', line 12 def api_key=(key) Thread.current["active.resource.currentthread.api_key"] = key end |