Class: Rudder::Analytics::Configuration
- Inherits:
-
Object
- Object
- Rudder::Analytics::Configuration
- Includes:
- Utils
- Defined in:
- lib/rudder/analytics/configuration.rb
Constant Summary
Constants included from Utils
Utils::UTC_OFFSET_WITHOUT_COLON, Utils::UTC_OFFSET_WITH_COLON
Instance Attribute Summary collapse
-
#backoff_policy ⇒ Object
readonly
Returns the value of attribute backoff_policy.
-
#batch_size ⇒ Object
readonly
Returns the value of attribute batch_size.
-
#data_plane_url ⇒ Object
readonly
Returns the value of attribute data_plane_url.
-
#gzip ⇒ Object
readonly
Returns the value of attribute gzip.
-
#max_queue_size ⇒ Object
readonly
Returns the value of attribute max_queue_size.
-
#on_error ⇒ Object
readonly
Returns the value of attribute on_error.
-
#on_error_with_messages ⇒ Object
readonly
Returns the value of attribute on_error_with_messages.
-
#retries ⇒ Object
readonly
Returns the value of attribute retries.
-
#ssl ⇒ Object
readonly
Returns the value of attribute ssl.
-
#stub ⇒ Object
readonly
Returns the value of attribute stub.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
-
#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 Utils
#check_string, #date_in_iso8601, #datetime_in_iso8601, #formatted_offset, #isoify_dates, #isoify_dates!, #seconds_to_utc_offset, #stringify_keys, #symbolize_keys, #symbolize_keys!, #time_in_iso8601, #uid
Constructor Details
#initialize(settings = {}) ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rudder/analytics/configuration.rb', line 12 def initialize(settings = {}) symbolized_settings = symbolize_keys(settings) @test = symbolized_settings[:test] @write_key = symbolized_settings[:write_key] @data_plane_url = symbolized_settings[:data_plane_url] @max_queue_size = symbolized_settings[:max_queue_size] || Defaults::Queue::MAX_SIZE @ssl = symbolized_settings[:ssl] @on_error = symbolized_settings[:on_error] || proc { |status, error| } @on_error_with_messages = symbolized_settings[:on_error_with_messages] || proc { |status, error, | } @stub = symbolized_settings[:stub] @batch_size = symbolized_settings[:batch_size] || Defaults::MessageBatch::MAX_SIZE @gzip = symbolized_settings[:gzip] @backoff_policy = symbolized_settings[:backoff_policy] @retries = symbolized_settings[:retries] raise ArgumentError, 'Missing required option :write_key' \ unless @write_key raise ArgumentError, 'Data plane url must be initialized' \ unless @data_plane_url end |
Instance Attribute Details
#backoff_policy ⇒ Object (readonly)
Returns the value of attribute backoff_policy.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def backoff_policy @backoff_policy end |
#batch_size ⇒ Object (readonly)
Returns the value of attribute batch_size.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def batch_size @batch_size end |
#data_plane_url ⇒ Object (readonly)
Returns the value of attribute data_plane_url.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def data_plane_url @data_plane_url end |
#gzip ⇒ Object (readonly)
Returns the value of attribute gzip.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def gzip @gzip end |
#max_queue_size ⇒ Object (readonly)
Returns the value of attribute max_queue_size.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def max_queue_size @max_queue_size end |
#on_error ⇒ Object (readonly)
Returns the value of attribute on_error.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def on_error @on_error end |
#on_error_with_messages ⇒ Object (readonly)
Returns the value of attribute on_error_with_messages.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def @on_error_with_messages end |
#retries ⇒ Object (readonly)
Returns the value of attribute retries.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def retries @retries end |
#ssl ⇒ Object (readonly)
Returns the value of attribute ssl.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def ssl @ssl end |
#stub ⇒ Object (readonly)
Returns the value of attribute stub.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def stub @stub end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def test @test end |
#write_key ⇒ Object (readonly)
Returns the value of attribute write_key.
10 11 12 |
# File 'lib/rudder/analytics/configuration.rb', line 10 def write_key @write_key end |