Module: AussieSMS
Constant Summary collapse
- API_URL =
"https://api.aussiesms.com.au"
Instance Method Summary collapse
- #balance ⇒ Object
- #from ⇒ Object
- #from=(value) ⇒ Object
- #id ⇒ Object
- #id=(value) ⇒ Object
- #password ⇒ Object
- #password=(value) ⇒ Object
- #send(message, options = {}) ⇒ Object
Instance Method Details
#balance ⇒ Object
60 61 62 63 64 65 |
# File 'lib/aussiesms.rb', line 60 def balance apicall("querybalance", { :mobileID => @id, :password => @password }).body.to_i end |
#from ⇒ Object
27 28 29 |
# File 'lib/aussiesms.rb', line 27 def from @from end |
#from=(value) ⇒ Object
31 32 33 |
# File 'lib/aussiesms.rb', line 31 def from=(value) @from = value end |
#id ⇒ Object
11 12 13 |
# File 'lib/aussiesms.rb', line 11 def id @id end |
#id=(value) ⇒ Object
15 16 17 |
# File 'lib/aussiesms.rb', line 15 def id=(value) @id = value end |
#password ⇒ Object
19 20 21 |
# File 'lib/aussiesms.rb', line 19 def password @password end |
#password=(value) ⇒ Object
23 24 25 |
# File 'lib/aussiesms.rb', line 23 def password=(value) @password = value end |
#send(message, options = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/aussiesms.rb', line 35 def send(, ={}) send_resp = apicall("sendsms", { :text => , :to => [:to], :from => [:from] || @from, :mobileID => @id, :password => @password, :msg_type => "SMS_TEXT" }) msg_id = send_resp.body.split(':')[1] check_resp = apicall("querymessage", { :mobileID => @id, :password => @password, :msg_id => msg_id }) if check_resp.body.split(':')[0] != '1' false else true end end |