Class: Exotel::Sms

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/exotel/sms.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSms

Returns a new instance of Sms.



8
# File 'lib/exotel/sms.rb', line 8

def initialize; end

Class Method Details

.details(params = {}) ⇒ Object



14
15
16
# File 'lib/exotel/sms.rb', line 14

def self.details(params={})
  self.new.details(params)
end

.send(params = {}) ⇒ Object



10
11
12
# File 'lib/exotel/sms.rb', line 10

def self.send(params={})
  self.new.send(params)
end

Instance Method Details

#details(sid) ⇒ Object



26
27
28
29
# File 'lib/exotel/sms.rb', line 26

def details(sid)
  response = self.class.get("/#{Exotel.exotel_sid}/Sms/Messages/#{sid}",  :basic_auth => auth)
  handle_response(response)
end

#send(params = {}) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/exotel/sms.rb', line 18

def send(params={})
  if valid?(params)
    params = transfrom_params(params)
    response = self.class.post("/#{Exotel.exotel_sid}/Sms/send",  {:body => params, :basic_auth => auth })
    handle_response(response)
  end  
end