class Itly::Event

Event object used to communicate data between Itly core SDK and its plugins

Properties: name: The event's name. properties: The event's properties. id: The event's unique ID in Iteratively. version: The event's version, e.g. 2.0.1. plugins: Granular Event Destinations: to control to which plugin to forward this event to

Attributes

id[R]
name[R]
plugins[R]
properties[R]
version[R]

Public Class Methods

new(name:, properties: {}, id: nil, version: nil, plugins: {}) click to toggle source

Create a new Event object

@param [String] name: The event's name. @param [Hash] properties: The event's properties. @param [String] id: The event's unique ID in Iteratively. @param [String] version: The event's version, e.g. 2.0.1. @param [Hash] plugins: Granular Event Destinations: to control to which plugin to forward this event to

# File lib/itly/event.rb, line 26
def initialize(name:, properties: {}, id: nil, version: nil, plugins: {})
  @name = name
  @properties = properties
  @id = id
  @version = version
  @plugins = plugins.transform_keys(&:to_s)
end

Public Instance Methods

==(other) click to toggle source

Compare the object to another

@param [Object] other: the object to compare to

@return [True/False] are the objects similar

# File lib/itly/event.rb, line 53
def ==(other)
  other.class == self.class && [name, properties, id, version] ==
    [other.name, other.properties, other.id, other.version]
end
to_s() click to toggle source

Describe the object

@return [String] the object description

# File lib/itly/event.rb, line 39
def to_s
  str = "#<#{self.class.name}: name: #{name}, "
  str += "id: #{id}, " unless id.nil?
  str += "version: #{version}, " unless version.nil?
  str + "properties: #{properties}>"
end