Class: Status
- Inherits:
-
Applications
- Object
- Applications
- Status
- Defined in:
- lib/coolsms/status.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#count ⇒ Object
Returns the value of attribute count.
-
#date ⇒ Object
Datetime Format YYYYMMDDHHMISS.
-
#unit ⇒ Object
minute(default), hour, day.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Status
constructor
A new instance of Status.
- #status ⇒ Object
Methods inherited from Applications
Constructor Details
#initialize(options = {}) ⇒ Status
Returns a new instance of Status.
13 14 15 |
# File 'lib/coolsms/status.rb', line 13 def initialize( = {}) self.set_fields() end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
11 12 13 |
# File 'lib/coolsms/status.rb', line 11 def channel @channel end |
#count ⇒ Object
Returns the value of attribute count.
3 4 5 |
# File 'lib/coolsms/status.rb', line 3 def count @count end |
#date ⇒ Object
Datetime Format YYYYMMDDHHMISS
9 10 11 |
# File 'lib/coolsms/status.rb', line 9 def date @date end |
#unit ⇒ Object
minute(default), hour, day
6 7 8 |
# File 'lib/coolsms/status.rb', line 6 def unit @unit end |
Instance Method Details
#status ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/coolsms/status.rb', line 17 def status fields = self.fields( :count, :unit, :date, :channel ) res = Request.new.get( "status", fields ) if res.code == "200" body = JSON.parse( res.body ) { ret: true, message: body, code: res.code } else { ret: false, code: res.code } end end |