Class: SimpleSegment::Configuration
- Inherits:
-
Object
- Object
- SimpleSegment::Configuration
- Defined in:
- lib/simple_segment/configuration.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#on_error ⇒ Object
readonly
Returns the value of attribute on_error.
-
#stub ⇒ Object
readonly
Returns the value of attribute stub.
-
#write_key ⇒ Object
readonly
Returns the value of attribute write_key.
Instance Method Summary collapse
-
#initialize(settings = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Methods included from Logging
Methods included from Utils
included, #isoify_dates, #isoify_dates!, #maybe_datetime_in_iso8601, #symbolize_keys
Constructor Details
#initialize(settings = {}) ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 |
# File 'lib/simple_segment/configuration.rb', line 10 def initialize(settings = {}) symbolized_settings = symbolize_keys(settings) @write_key = symbolized_settings[:write_key] @on_error = symbolized_settings[:on_error] || proc {} @stub = symbolized_settings[:stub] @logger = default_logger(symbolized_settings[:logger]) raise ArgumentError, 'Missing required option :write_key' \ unless @write_key end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/simple_segment/configuration.rb', line 8 def logger @logger end |
#on_error ⇒ Object (readonly)
Returns the value of attribute on_error.
8 9 10 |
# File 'lib/simple_segment/configuration.rb', line 8 def on_error @on_error end |
#stub ⇒ Object (readonly)
Returns the value of attribute stub.
8 9 10 |
# File 'lib/simple_segment/configuration.rb', line 8 def stub @stub end |
#write_key ⇒ Object (readonly)
Returns the value of attribute write_key.
8 9 10 |
# File 'lib/simple_segment/configuration.rb', line 8 def write_key @write_key end |