Class: Sent
- Inherits:
-
Applications
- Object
- Applications
- Sent
- Defined in:
- lib/coolsms/sent.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Message count defualt: 20.
-
#end ⇒ Object
DateFormat YYYY-MM-DD HH:MI:SS.
-
#gid ⇒ Object
Group ID.
-
#mid ⇒ Object
Message ID.
-
#notin_resultcode ⇒ Object
Returns the value of attribute notin_resultcode.
-
#page ⇒ Object
Returns the value of attribute page.
-
#rcpt ⇒ Object
Search for to number.
-
#resultcode ⇒ Object
Sending result code.
-
#start ⇒ Object
Date Format YYYY-MM-DD HH:MI:SS.
-
#status ⇒ Object
Message status.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Sent
constructor
A new instance of Sent.
- #sent ⇒ Object
Methods inherited from Applications
Constructor Details
#initialize(options = {}) ⇒ Sent
Returns a new instance of Sent.
32 33 34 |
# File 'lib/coolsms/sent.rb', line 32 def initialize(={}) self.set_fields( ) end |
Instance Attribute Details
#count ⇒ Object
Message count defualt: 20
5 6 7 |
# File 'lib/coolsms/sent.rb', line 5 def count @count end |
#end ⇒ Object
DateFormat YYYY-MM-DD HH:MI:SS
16 17 18 |
# File 'lib/coolsms/sent.rb', line 16 def end @end end |
#gid ⇒ Object
Group ID
30 31 32 |
# File 'lib/coolsms/sent.rb', line 30 def gid @gid end |
#mid ⇒ Object
Message ID
27 28 29 |
# File 'lib/coolsms/sent.rb', line 27 def mid @mid end |
#notin_resultcode ⇒ Object
Returns the value of attribute notin_resultcode.
24 25 26 |
# File 'lib/coolsms/sent.rb', line 24 def notin_resultcode @notin_resultcode end |
#page ⇒ Object
Returns the value of attribute page.
7 8 9 |
# File 'lib/coolsms/sent.rb', line 7 def page @page end |
#rcpt ⇒ Object
Search for to number
10 11 12 |
# File 'lib/coolsms/sent.rb', line 10 def rcpt @rcpt end |
#resultcode ⇒ Object
Sending result code
22 23 24 |
# File 'lib/coolsms/sent.rb', line 22 def resultcode @resultcode end |
#start ⇒ Object
Date Format YYYY-MM-DD HH:MI:SS
13 14 15 |
# File 'lib/coolsms/sent.rb', line 13 def start @start end |
#status ⇒ Object
Message status
19 20 21 |
# File 'lib/coolsms/sent.rb', line 19 def status @status end |
Instance Method Details
#sent ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/coolsms/sent.rb', line 36 def sent fields = self.fields( :count, :page, :rcpt, :start, :end, :status, :resultcode, :notin_resultcode, :mid, :gid ) res = Request.new.get( "sent", 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 |