Class: SimpleSegment::Operations::Group

Inherits:
Operation
  • Object
show all
Defined in:
lib/simple_segment/operations/group.rb

Constant Summary

Constants inherited from Operation

Operation::DEFAULT_CONTEXT

Instance Attribute Summary

Attributes inherited from Operation

#options, #request

Instance Method Summary collapse

Methods inherited from Operation

#initialize

Constructor Details

This class inherits a constructor from SimpleSegment::Operations::Operation

Instance Method Details

#build_payloadObject

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
15
# File 'lib/simple_segment/operations/group.rb', line 8

def build_payload
  raise ArgumentError, 'group_id must be present' unless options[:group_id]

  base_payload.merge({
    traits: options[:traits],
    groupId: options[:group_id]
  })
end

#callObject



4
5
6
# File 'lib/simple_segment/operations/group.rb', line 4

def call
  request.post('/v1/group', build_payload)
end