Class: Itly::Plugin::Snowplow::PageOptions

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

Overview

Snowplow specific plugin options class for calls to page

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PageOptions.



19
20
21
22
23
# File 'lib/itly/plugin/snowplow/call_options.rb', line 19

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

Instance Attribute Details

#callbackObject (readonly)

Returns the value of attribute callback.



17
18
19
# File 'lib/itly/plugin/snowplow/call_options.rb', line 17

def callback
  @callback
end

#contextsObject (readonly)

Returns the value of attribute contexts.



17
18
19
# File 'lib/itly/plugin/snowplow/call_options.rb', line 17

def contexts
  @contexts
end

Instance Method Details

#to_sObject



25
26
27
28
29
# File 'lib/itly/plugin/snowplow/call_options.rb', line 25

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