Class: Mailersend::ScheduledMessages

Inherits:
Object
  • Object
show all
Defined in:
lib/mailersend/scheduled_messages/scheduled_messages.rb

Overview

Scheduled messages endpoint from MailerSend API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client = Mailersend::Client.new) ⇒ ScheduledMessages

Returns a new instance of ScheduledMessages.



13
14
15
16
17
18
19
20
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 13

def initialize(client = Mailersend::Client.new)
  @client = client
  @domain_id = domain_id
  @status = status
  @page = page
  @limit = limit
  @message_id = message_id
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



6
7
8
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 6

def client
  @client
end

#domain_idObject

Returns the value of attribute domain_id.



6
7
8
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 6

def domain_id
  @domain_id
end

#limitObject

Returns the value of attribute limit.



6
7
8
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 6

def limit
  @limit
end

#message_idObject

Returns the value of attribute message_id.



6
7
8
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 6

def message_id
  @message_id
end

#pageObject

Returns the value of attribute page.



6
7
8
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 6

def page
  @page
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 6

def status
  @status
end

Instance Method Details

#delete(message_id:) ⇒ Object



30
31
32
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 30

def delete(message_id:)
  client.http.delete("#{MAILERSEND_API_URL}/message-schedules/#{message_id}")
end

#get_listObject



22
23
24
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 22

def get_list(*)
  client.http.get("#{MAILERSEND_API_URL}/message-schedules")
end

#get_single(message_id:) ⇒ Object



26
27
28
# File 'lib/mailersend/scheduled_messages/scheduled_messages.rb', line 26

def get_single(message_id:)
  client.http.get("#{MAILERSEND_API_URL}/message-schedules/#{message_id}")
end