Class: Emarsys::Export

Inherits:
DataObject show all
Defined in:
lib/emarsys/data_objects/export.rb

Overview

Methods for the Export API

Class Method Summary collapse

Methods inherited from DataObject

delete, get, parameterize_params, post, put, #request

Class Method Details

.data(id, offset: nil, limit: nil, account: nil) ⇒ String

Download export data

Examples:

Emarsys::Export.data(2)

Parameters:

  • id (Integer, String)

    The internal emarsys id

  • offset (Hash) (defaults to: nil)

    a customizable set of options

  • limit (Hash) (defaults to: nil)

    a customizable set of options

Options Hash (offset:):

  • Defines (Integer)

    the ID to start listing from

Options Hash (limit:):

  • Defines (Integer)

    how many IDs are listed

Returns:

  • (String)

    text/csv



28
29
30
31
32
33
# File 'lib/emarsys/data_objects/export.rb', line 28

def data(id, offset: nil, limit: nil, account: nil)
  params = {}
  params.merge!(:offset => offset) if offset
  params.merge!(:limit => limit) if limit
  get , "export/#{id}/data", params
end

.resource(id, account: nil) ⇒ Hash

Find a specific export

Examples:

Emarsys::Export.resource(2)

Parameters:

  • id (Integer, String)

    The internal emarsys id

Returns:

  • (Hash)

    Result data



16
17
18
# File 'lib/emarsys/data_objects/export.rb', line 16

def resource(id, account: nil)
  get , "export/#{id}", {}
end