Class: SimpleSegment::Operations::Operation

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/simple_segment/operations/operation.rb

Direct Known Subclasses

Alias, Group, Identify, Page, Track

Constant Summary collapse

DEFAULT_CONTEXT =
{
  library: {
    name: 'simple_segment',
    version: SimpleSegment::VERSION
  }
}.freeze

Instance Method Summary collapse

Methods included from Utils

included, #isoify_dates, #isoify_dates!, #maybe_datetime_in_iso8601, #symbolize_keys

Constructor Details

#initialize(client, options = {}) ⇒ Operation

Returns a new instance of Operation.



15
16
17
18
19
# File 'lib/simple_segment/operations/operation.rb', line 15

def initialize(client, options = {})
  @options = options
  @context = DEFAULT_CONTEXT.merge(options[:context].to_h)
  @request = Request.new(client)
end

Instance Method Details

#callObject



21
22
23
# File 'lib/simple_segment/operations/operation.rb', line 21

def call
  raise 'Must be implemented in a subclass'
end