Class: Mogreet::List

Inherits:
Object
  • Object
show all
Defined in:
lib/mogreet/list.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ List

Returns a new instance of List.



3
4
5
# File 'lib/mogreet/list.rb', line 3

def initialize(client)
  @client = client
end

Instance Method Details

#append(options = {}) ⇒ Object

list_id numbers



22
23
24
25
26
# File 'lib/mogreet/list.rb', line 22

def append(options ={})
  # TODO clone options?
  options[:numbers] = options[:numbers].join(',') if options[:numbers].is_a?(Array)
  @client.get_request('/cm/list.append', options)      
end

#create(options = {}) ⇒ Object

name



16
17
18
# File 'lib/mogreet/list.rb', line 16

def create(options ={})
  @client.get_request('/cm/list.create', options)      
end

#destroy(options) ⇒ Object

list_id name



62
63
64
# File 'lib/mogreet/list.rb', line 62

def destroy(options)
  @client.get_request('/cm/list.destroy', options)
end

#download(options) ⇒ Object

list_id format



50
51
52
# File 'lib/mogreet/list.rb', line 50

def download(options)
  @client.get_request('/cm/list.download', options)
end

#empty(options) ⇒ Object

list_id name



56
57
58
# File 'lib/mogreet/list.rb', line 56

def empty(options)
  @client.get_request('/cm/list.empty', options)
end

#info(options = {}) ⇒ Object



11
12
13
# File 'lib/mogreet/list.rb', line 11

def info(options ={})
  @client.get_request('/cm/list.info', options)      
end

#list(options = {}) ⇒ Object



7
8
9
# File 'lib/mogreet/list.rb', line 7

def list(options ={})
  @client.get_request('/cm/list.list', options)      
end

#prune(options = {}) ⇒ Object

list_id numbers



30
31
32
33
34
# File 'lib/mogreet/list.rb', line 30

def prune(options ={})
  # TODO clone options?
  options[:numbers] = options[:numbers].join(',') if options[:numbers].is_a?(Array)
  @client.get_request('/cm/list.prune', options)      
end

#send(options) ⇒ Object

list_id campaign_id subject message content_id content_url to_name from_name



44
45
46
# File 'lib/mogreet/list.rb', line 44

def send(options)      
  @client.get_request('/cm/list.send', options)
end