Class: Emarsys::EmailLaunchStatus

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

Overview

Internal helper class for valid email launch status. Emarsys has no implementation for this data resource.

Constant Summary collapse

CODES =
[
  {'0'   => 'Not launched'},
  {'1'   => 'Launch called via API, launching in Progress'},
  {'2'   => 'Email launched or scheduled for future launch'},
  {'10'   => 'Error (details in api_error)'}
]

Class Method Summary collapse

Methods inherited from DataObject

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

Class Method Details

.collectionHash

List email launch status codes

Examples:

Emarsys::EmailLaunchStatus.collection

Returns:

  • (Hash)

    List of email launch status



23
24
25
# File 'lib/emarsys/data_objects/email_launch_status.rb', line 23

def collection
  CODES
end

.resource(id) ⇒ Hash

Get a specific email launch status

Examples:

Emarsys::EmailLaunchStatus.resource('1')

Parameters:

  • id (Integer, String)

    of the code

Returns:

  • (Hash)

    Key-Value-Pair of the launch code



33
34
35
# File 'lib/emarsys/data_objects/email_launch_status.rb', line 33

def resource(id)
  CODES.select{|hash| hash.has_key?(id.to_s)}[0]
end