Class: LightrateClient::Configuration
- Inherits:
-
Object
- Object
- LightrateClient::Configuration
- Defined in:
- lib/lightrate_client/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#application_id ⇒ Object
Returns the value of attribute application_id.
-
#default_local_bucket_size ⇒ Object
Returns the value of attribute default_local_bucket_size.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#retry_attempts ⇒ Object
Returns the value of attribute retry_attempts.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 |
# File 'lib/lightrate_client/configuration.rb', line 7 def initialize @timeout = 30 @retry_attempts = 3 @logger = nil @default_local_bucket_size = 5 end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/lightrate_client/configuration.rb', line 5 def api_key @api_key end |
#application_id ⇒ Object
Returns the value of attribute application_id.
5 6 7 |
# File 'lib/lightrate_client/configuration.rb', line 5 def application_id @application_id end |
#default_local_bucket_size ⇒ Object
Returns the value of attribute default_local_bucket_size.
5 6 7 |
# File 'lib/lightrate_client/configuration.rb', line 5 def default_local_bucket_size @default_local_bucket_size end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/lightrate_client/configuration.rb', line 5 def logger @logger end |
#retry_attempts ⇒ Object
Returns the value of attribute retry_attempts.
5 6 7 |
# File 'lib/lightrate_client/configuration.rb', line 5 def retry_attempts @retry_attempts end |
#timeout ⇒ Object
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/lightrate_client/configuration.rb', line 5 def timeout @timeout end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lightrate_client/configuration.rb', line 18 def to_h { api_key: "******", application_id: application_id, timeout: timeout, retry_attempts: retry_attempts, logger: logger, default_local_bucket_size: default_local_bucket_size } end |
#valid? ⇒ Boolean
14 15 16 |
# File 'lib/lightrate_client/configuration.rb', line 14 def valid? api_key && application_id end |