Class: Sendara::Configuration
- Inherits:
-
Object
- Object
- Sendara::Configuration
- Defined in:
- lib/sendara/railtie.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
- #client_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 |
# File 'lib/sendara/railtie.rb', line 9 def initialize @api_key = ENV["SENDARA_API_KEY"] @base_url = ENV["SENDARA_BASE_URL"] @timeout = nil @max_retries = nil end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/sendara/railtie.rb', line 7 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
7 8 9 |
# File 'lib/sendara/railtie.rb', line 7 def base_url @base_url end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
7 8 9 |
# File 'lib/sendara/railtie.rb', line 7 def max_retries @max_retries end |
#timeout ⇒ Object
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/sendara/railtie.rb', line 7 def timeout @timeout end |
Instance Method Details
#client_options ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/sendara/railtie.rb', line 16 def = {} [:base_url] = base_url unless base_url.nil? || base_url.to_s.empty? [:timeout] = timeout unless timeout.nil? [:max_retries] = max_retries unless max_retries.nil? end |