Class: Textmagic::REST::Schedules

Inherits:
ListResource show all
Defined in:
lib/textmagic-ruby/rest/scheduleds.rb

Instance Method Summary collapse

Methods inherited from ListResource

#initialize, #inspect

Methods included from Utils

#key_map, #resource, #to_camel_case, #to_underscore_case

Constructor Details

This class inherits a constructor from Textmagic::REST::ListResource

Instance Method Details

#create(params = {}) ⇒ Object

Creating is not supported



62
63
64
# File 'lib/textmagic-ruby/rest/scheduleds.rb', line 62

def create(params={})
  raise '`create` method is not supported for this resource.'
end

#delete(uid) ⇒ Object

Delete scheduled message by ID. Returns true if success.

uid

Schedule message ID. Required.

Example:

r = client.schedules.delete 182981


55
56
57
# File 'lib/textmagic-ruby/rest/scheduleds.rb', line 55

def delete(uid)
  super uid
end

#get(uid) ⇒ Object

Get Schedule by ID. Returns Schedule object.

uid

Schedule ID. Required.

Example:

@scheduled = client.schedules.get 19011


14
15
16
# File 'lib/textmagic-ruby/rest/scheduleds.rb', line 14

def get(uid)
  super uid
end

#list(params = {}) ⇒ Object

Get all user scheduled messages. Returns PaginateResource object, contains array of Schedule objects.

The following params keys are supported:

page

Fetch specified results page. Defaults 1

limit

How many results on page. Defaults 10

Example:

@schedules = client.schedules.list


32
33
34
35
36
37
# File 'lib/textmagic-ruby/rest/scheduleds.rb', line 32

def list(params={})
  [:search, 'search'].each do |search|
    params.delete search
  end
  super params
end

#update(uid, params = {}) ⇒ Object

Updating is not supported



42
43
44
# File 'lib/textmagic-ruby/rest/scheduleds.rb', line 42

def update(uid, params={})
  raise '`update` method is not supported for this resource.'
end