Class: KlaviyoAPI::Metric

Inherits:
Base
  • Object
show all
Extended by:
Support::Countable
Defined in:
lib/klaviyo_api/resources/metric.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Support::Countable

count

Methods inherited from Base

activate_session, element_path, headers, reset_session, #to_h

Class Method Details

.collection_path(prefix_options = {}, query_options = {}) ⇒ Object



18
19
20
# File 'lib/klaviyo_api/resources/metric.rb', line 18

def collection_path(prefix_options = {}, query_options = {})
  super prefix_options, query_options.deep_merge(api_key: headers['api-key'])
end

.eventsObject

Get all Events for all Metrics www.klaviyo.com/docs/api/metrics#metrics-timeline



24
25
26
# File 'lib/klaviyo_api/resources/metric.rb', line 24

def events
  KlaviyoAPI::Event.all
end

.find_single(_scope, _options) ⇒ Object



14
15
16
# File 'lib/klaviyo_api/resources/metric.rb', line 14

def find_single(_scope, _options)
  raise KlaviyoAPI::InvalidOperation, 'Cannot get single Metric via API. Please use KlaviyoAPI::Metric#all.'
end

Instance Method Details

#createObject



33
34
35
# File 'lib/klaviyo_api/resources/metric.rb', line 33

def create
  raise KlaviyoAPI::InvalidOperation, 'Cannot create Metrics via API.'
end

#destroyObject



29
30
31
# File 'lib/klaviyo_api/resources/metric.rb', line 29

def destroy
  raise KlaviyoAPI::InvalidOperation, 'Cannot delete Metrics via API.'
end

#updateObject



37
38
39
# File 'lib/klaviyo_api/resources/metric.rb', line 37

def update
  raise KlaviyoAPI::InvalidOperation, 'Cannot update Metrics via API.'
end