Class: Messente
Instance Method Summary collapse
- #balance ⇒ Object
-
#initialize(options) ⇒ Messente
constructor
A new instance of Messente.
- #report(options) ⇒ Object
- #send(options) ⇒ Object
Constructor Details
#initialize(options) ⇒ Messente
Returns a new instance of Messente.
10 11 12 |
# File 'lib/messente.rb', line 10 def initialize() @defaults = end |
Instance Method Details
#balance ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/messente.rb', line 24 def balance response = self.class.get("/get_balance/#{@defaults[:user]}/#{@defaults[:api_key]}") items = response.split(" ") return false if ("ERROR" == items[0]) items[1].to_f end |
#report(options) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/messente.rb', line 32 def report() response = self.class.get("/get_dlr_response/#{@defaults[:user]}/#{@defaults[:api_key]}/#{[:id]}") pp items = response.split(" ") return false if ("ERROR" == items[0]) items[1] end |
#send(options) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/messente.rb', line 14 def send() query = @defaults.merge() response = self.class.get("/send_sms_get", :query => query) items = response.split(" ") return false if ("ERROR" == items[0]) {:id => items[1], :price => items[2].to_f} end |