Class: CreateSend::Transactional::Timeline

Inherits:
CreateSend
  • Object
show all
Defined in:
lib/createsend/transactional_timeline.rb

Instance Attribute Summary collapse

Attributes inherited from CreateSend

#auth_details

Instance Method Summary collapse

Methods inherited from CreateSend

#add_auth_details_to_options, #administrators, #auth, authorize_url, #billing_details, #clients, #countries, #delete, exchange_token, #external_session_url, #get, #get_primary_contact, #handle_response, #post, #put, refresh_access_token, #refresh_token, #set_primary_contact, #systemdate, #timezones, user_agent

Constructor Details

#initialize(auth, client_id = nil) ⇒ Timeline

Returns a new instance of Timeline.



6
7
8
9
10
# File 'lib/createsend/transactional_timeline.rb', line 6

def initialize(auth, client_id = nil)
  @auth      = auth
  @client_id = client_id
  super
end

Instance Attribute Details

#client_idObject (readonly)

Returns the value of attribute client_id.



4
5
6
# File 'lib/createsend/transactional_timeline.rb', line 4

def client_id
  @client_id
end

Instance Method Details

#details(message_id, options = {}) ⇒ Object



24
25
26
27
28
# File 'lib/createsend/transactional_timeline.rb', line 24

def details(message_id, options = {})
  options = add_client_id(options)
  response = get "/transactional/messages/#{message_id}", { :query => options }
  Hashie::Mash.new(response)
end

#messages(options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/createsend/transactional_timeline.rb', line 12

def messages(options = {})
  options = add_client_id(options)
  response = get "/transactional/messages", { :query => options }
  response.map{|item| Hashie::Mash.new(item)}
end

#resend(message_id) ⇒ Object



30
31
32
33
# File 'lib/createsend/transactional_timeline.rb', line 30

def resend(message_id)
  response = post "/transactional/messages/#{message_id}/resend"
  response.map{|item| Hashie::Mash.new(item)}
end

#statistics(options = {}) ⇒ Object



18
19
20
21
22
# File 'lib/createsend/transactional_timeline.rb', line 18

def statistics(options = {})
  options = add_client_id(options)
  response = get "/transactional/statistics", { :query => options }
  Hashie::Mash.new(response)
end