Class: Timepad::Maillist
Instance Method Summary collapse
-
#add_items(maillist_id, subscribers) ⇒ Object
Add maillist subscribers.
-
#create(title, subscribers) ⇒ Object
Create maillist.
-
#get(maillist_id) ⇒ Array
Get maillist subscribers.
-
#get_list ⇒ Array
Get all maillists.
-
#initialize(timepad_client) ⇒ Maillist
constructor
A new instance of Maillist.
Methods inherited from Base
#make_query, #make_uri, #request, #subscribers_to_hash
Constructor Details
#initialize(timepad_client) ⇒ Maillist
Returns a new instance of Maillist.
4 5 6 |
# File 'lib/timepad/maillist.rb', line 4 def initialize(timepad_client) @client = timepad_client end |
Instance Method Details
#add_items(maillist_id, subscribers) ⇒ Object
Add maillist subscribers
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/timepad/maillist.rb', line 27 def add_items maillist_id, subscribers if subscribers.kind_of? Hash subscribers = [subscribers] end params = subscribers_to_hash(subscribers) params[:m_id] = maillist_id request 'add_items', params end |
#create(title, subscribers) ⇒ Object
Create maillist
42 43 44 45 46 47 |
# File 'lib/timepad/maillist.rb', line 42 def create title, subscribers params = subscribers_to_hash(subscribers) params[:name] = title request 'create', params end |
#get(maillist_id) ⇒ Array
Get maillist subscribers
19 20 21 |
# File 'lib/timepad/maillist.rb', line 19 def get maillist_id request 'get', :maillist => maillist_id end |
#get_list ⇒ Array
Get all maillists
11 12 13 |
# File 'lib/timepad/maillist.rb', line 11 def get_list request 'getlist' end |