Class: CTM::MessageList
Instance Attribute Summary
Attributes inherited from List
#filters, #list_type, #objects, #page, #per_page, #token, #total_entries, #total_pages
Instance Method Summary collapse
-
#initialize(options = {}, token = nil) ⇒ MessageList
constructor
A new instance of MessageList.
- #send_message(to, from, message) ⇒ Object
Methods inherited from List
#create, #each, #each_page, #find, #get
Constructor Details
#initialize(options = {}, token = nil) ⇒ MessageList
Returns a new instance of MessageList.
3 4 5 6 |
# File 'lib/ctm/message_list.rb', line 3 def initialize(={}, token=nil) super('Message', , token) @list_type_path = "accounts/#{@account_id}/sms" end |
Instance Method Details
#send_message(to, from, message) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/ctm/message_list.rb', line 8 def (to, from, ) = {:to => to, :from => from, :msg => } path_str = "/api/v1/#{@list_type_path}.json" res = self.class.post(path_str, :body => .merge(:auth_token => @token)) data = res.parsed_response puts data.inspect (data["status"] == "processing") end |