Class: Itly::Plugin::Snowplow::Context

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

Overview

Snowplow context to be used by CallOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema:, data:) ⇒ Context

Returns a new instance of Context.



12
13
14
15
# File 'lib/itly/plugin/snowplow/context.rb', line 12

def initialize(schema:, data:)
  @schema = schema
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



10
11
12
# File 'lib/itly/plugin/snowplow/context.rb', line 10

def data
  @data
end

#schemaObject (readonly)

Returns the value of attribute schema.



10
11
12
# File 'lib/itly/plugin/snowplow/context.rb', line 10

def schema
  @schema
end

Instance Method Details

#to_sObject



21
22
23
# File 'lib/itly/plugin/snowplow/context.rb', line 21

def to_s
  "#<Snowplow::Context schema: #{schema} data: #{data}>"
end

#to_self_describing_jsonObject



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

def to_self_describing_json
  SnowplowTracker::SelfDescribingJson.new schema, data
end