Class: Itly::Plugin::Snowplow::Context
- Inherits:
-
Object
- Object
- Itly::Plugin::Snowplow::Context
- Defined in:
- lib/itly/plugin/snowplow/context.rb
Overview
Snowplow context to be used by CallOptions
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(schema:, data:) ⇒ Context
constructor
A new instance of Context.
- #to_s ⇒ Object
- #to_self_describing_json ⇒ Object
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/itly/plugin/snowplow/context.rb', line 10 def data @data end |
#schema ⇒ Object (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_s ⇒ Object
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_json ⇒ Object
17 18 19 |
# File 'lib/itly/plugin/snowplow/context.rb', line 17 def to_self_describing_json SnowplowTracker::SelfDescribingJson.new schema, data end |