Class: CleverElements::Lists

Inherits:
Resource show all
Defined in:
lib/cleverelements/lists.rb

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from CleverElements::Resource

Instance Method Details

#allObject



5
6
7
# File 'lib/cleverelements/lists.rb', line 5

def all
  @client.api_get_list.body
end

#create(name = "", description = "") ⇒ Object



13
14
15
# File 'lib/cleverelements/lists.rb', line 13

def create(name = "", description = "")
  @client.api_add_list(listName: name, listDescription: description).body
end

#destroy(id) ⇒ Object



17
18
19
# File 'lib/cleverelements/lists.rb', line 17

def destroy(id)
  @client.api_delete_list({listID: id}).body
end

#find(id) ⇒ Object



9
10
11
# File 'lib/cleverelements/lists.rb', line 9

def find(id)
  @client.api_get_list_details({listID: id}).body
end

#get_subscribers(list_id, offset = 0, limit = 100) ⇒ Object



21
22
23
24
# File 'lib/cleverelements/lists.rb', line 21

def get_subscribers(list_id, offset = 0, limit = 100)
  # cli.lists.get_subscribers(335333, 0, 100)
  @client.api_get_subscriber({listID: list_id, start: offset, count: limit}).body
end

#get_subscribers_with_details(list_id, offset = 0, limit = 100) ⇒ Object



26
27
28
29
# File 'lib/cleverelements/lists.rb', line 26

def get_subscribers_with_details(list_id, offset = 0, limit = 100)
  # cli.lists.get_subscribers_with_details(335333, 0, 100)
  @client.api_get_subscriber_details({listID: list_id, start: offset, count: limit}).body
end

#get_unsubscribed(list_id, offset = 0, limit = 100) ⇒ Object



31
32
33
34
# File 'lib/cleverelements/lists.rb', line 31

def get_unsubscribed(list_id, offset = 0, limit = 100)
  # cli.lists.get_unsubscribed(335333, 0, 100)
  @client.api_get_subscriber_unsubscribes({listID: list_id, start: offset, count: limit}).body
end