Class: Iter::Configuration
- Inherits:
-
Object
- Object
- Iter::Configuration
- Defined in:
- lib/iter/configuration.rb
Overview
Provides an object to store global configuration settings.
This class is typically not used directly, but by calling Iter.configure, which creates and updates a single instance of Models::Configuration.
An alternative way to set global configuration settings is by storing them in the following environment variables:
ITER_API_KEYto store the API key for the Iterable API
In case both methods are used together, Iter.configure takes precedence.
Instance Attribute Summary collapse
-
#api_key ⇒ String
The API key for the API calls.
-
#mock ⇒ Boolean
Whether to mock the HTTP calls to Iterable.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Initialize the global configuration settings, using the values of the specified following environment variables by default.
Constructor Details
#initialize ⇒ Configuration
Initialize the global configuration settings, using the values of the specified following environment variables by default.
34 35 36 37 |
# File 'lib/iter/configuration.rb', line 34 def initialize @api_key = ENV['ITER_API_KEY'] @mock = ENV['ITER_MOCK'] == '1' end |
Instance Attribute Details
#api_key ⇒ String
Returns the API key for the API calls.
27 28 29 |
# File 'lib/iter/configuration.rb', line 27 def api_key @api_key end |
#mock ⇒ Boolean
Returns whether to mock the HTTP calls to Iterable.
30 31 32 |
# File 'lib/iter/configuration.rb', line 30 def mock @mock end |