Class: Itly::Plugin::Snowplow::TrackOptions

Inherits:
CallOptions
  • Object
show all
Defined in:
lib/itly/plugin/snowplow/call_options.rb

Overview

Snowplow specific plugin options class for calls to track

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contexts: nil, callback: nil) ⇒ TrackOptions

Returns a new instance of TrackOptions.



38
39
40
41
42
# File 'lib/itly/plugin/snowplow/call_options.rb', line 38

def initialize(contexts: nil, callback: nil)
  super()
  @contexts = contexts
  @callback = callback
end

Instance Attribute Details

#callbackObject (readonly)

Returns the value of attribute callback.



36
37
38
# File 'lib/itly/plugin/snowplow/call_options.rb', line 36

def callback
  @callback
end

#contextsObject (readonly)

Returns the value of attribute contexts.



36
37
38
# File 'lib/itly/plugin/snowplow/call_options.rb', line 36

def contexts
  @contexts
end

Instance Method Details

#to_sObject



44
45
46
47
48
# File 'lib/itly/plugin/snowplow/call_options.rb', line 44

def to_s
  class_name = self.class.name.split('::').last
  contexts_str = contexts.nil? ? 'nil' : "[#{contexts.collect(&:to_s).join ', '}]"
  "#<Snowplow::#{class_name} contexts: #{contexts_str} callback: #{callback.nil? ? 'nil' : 'provided'}>"
end