Class: SevenApi::Resources::Analytics

Inherits:
SevenApi::Resource show all
Defined in:
lib/seven_api/resources/analytics.rb

Constant Summary collapse

PATHS =
{
  :by_country => "/country",
  :by_date => "/date",
  :by_label => "/label",
  :by_subaccount => "/subaccount",
}

Constants inherited from SevenApi::Resource

SevenApi::Resource::BASE_PATH

Instance Attribute Summary

Attributes inherited from SevenApi::Resource

#api_key, #builder, #conn, #endpoint, #http_methods, #request_methods, #sent_with

Instance Method Summary collapse

Methods inherited from SevenApi::Resource

get_endpoint, get_http_methods, #initialize

Constructor Details

This class inherits a constructor from SevenApi::Resource

Instance Method Details

#by_country(params = {}) ⇒ Array

Retrieve analytics grouped by country read more: docs.seven.io/en/rest-api/endpoints/account#statistics

Parameters:

  • params (Hash) (defaults to: {})

Returns:

  • (Array)


26
27
28
# File 'lib/seven_api/resources/analytics.rb', line 26

def by_country(params = {})
  request({}, params, PATHS[:by_country])
end

#by_date(params = {}) ⇒ Array

Retrieve analytics grouped by date read more: docs.seven.io/en/rest-api/endpoints/account#statistics

Parameters:

  • params (Hash) (defaults to: {})

Returns:

  • (Array)


34
35
36
# File 'lib/seven_api/resources/analytics.rb', line 34

def by_date(params = {})
  request({}, params, PATHS[:by_date])
end

#by_label(params = {}) ⇒ Array

Retrieve analytics grouped by label read more: docs.seven.io/en/rest-api/endpoints/account#statistics

Parameters:

  • params (Hash) (defaults to: {})

Returns:

  • (Array)


42
43
44
# File 'lib/seven_api/resources/analytics.rb', line 42

def by_label(params = {})
  request({}, params, PATHS[:by_label])
end

#by_subaccount(params = {}) ⇒ Array

Retrieve analytics grouped by subaccount read more: docs.seven.io/en/rest-api/endpoints/account#statistics

Parameters:

  • params (Hash) (defaults to: {})

Returns:

  • (Array)


50
51
52
# File 'lib/seven_api/resources/analytics.rb', line 50

def by_subaccount(params = {})
  request({}, params, PATHS[:by_subaccount])
end