Class: SimpleSegment::Operations::Track
- Defined in:
- lib/simple_segment/operations/track.rb
Constant Summary
Constants inherited from Operation
Instance Attribute Summary
Attributes inherited from Operation
Instance Method Summary collapse
Methods inherited from Operation
Methods included from Utils
included, #isoify_dates, #isoify_dates!, #maybe_datetime_in_iso8601, #symbolize_keys
Constructor Details
This class inherits a constructor from SimpleSegment::Operations::Operation
Instance Method Details
#build_payload ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/simple_segment/operations/track.rb', line 8 def build_payload raise ArgumentError, 'event name must be present' \ unless [:event] properties = [:properties] && isoify_dates!([:properties]) base_payload.merge( event: [:event], properties: properties ) end |
#call ⇒ Object
4 5 6 |
# File 'lib/simple_segment/operations/track.rb', line 4 def call request.post('/v1/track', build_payload) end |