Class: EasySMS::MessageResource
- Inherits:
-
Struct
- Object
- Struct
- EasySMS::MessageResource
- Defined in:
- lib/easy_sms/message_resource.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client
2 3 4 |
# File 'lib/easy_sms/message_resource.rb', line 2 def client @client end |
Instance Method Details
#create(attrs = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/easy_sms/message_resource.rb', line 3 def create(attrs = {}) res = client.post('/messages', attrs) JSON.parse(res).tap do |json| json['c_at'] = Time.parse(json['c_at']) if json['c_at'] end end |