Class: Bottle::Message
- Inherits:
-
Object
- Object
- Bottle::Message
- Defined in:
- lib/api_objects/message.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#body ⇒ Object
Returns the value of attribute body.
-
#body_decoded ⇒ Object
Returns the value of attribute body_decoded.
-
#conversation_id ⇒ Object
Returns the value of attribute conversation_id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#created_from_rule_id ⇒ Object
Returns the value of attribute created_from_rule_id.
-
#delivered_at ⇒ Object
Returns the value of attribute delivered_at.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#file ⇒ Object
Returns the value of attribute file.
-
#from_number ⇒ Object
Returns the value of attribute from_number.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object_key ⇒ Object
Returns the value of attribute object_key.
-
#object_name ⇒ Object
Returns the value of attribute object_name.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#to ⇒ Object
Returns the value of attribute to.
-
#to_number ⇒ Object
Returns the value of attribute to_number.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#viewed_at ⇒ Object
Returns the value of attribute viewed_at.
Instance Method Summary collapse
-
#initialize(to = nil, name = nil, body = nil, file = nil, tags = nil) ⇒ Message
constructor
A new instance of Message.
- #send(client) ⇒ Object
Constructor Details
#initialize(to = nil, name = nil, body = nil, file = nil, tags = nil) ⇒ Message
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/api_objects/message.rb', line 8 def initialize(to=nil, name=nil, body=nil, file=nil, =nil) @url_extension = 'messages' if to.is_a?(Hash) attributes = to.convert_keys_to_symbols @to = attributes[:to] @name = attributes[:name] @body = attributes[:body] @file = attributes[:file] = attributes[:tags] @id = attributes[:id] @from_number = attributes[:from_number] @to_number = attributes[:to_number] @delivered_at = attributes[:delivered_at] @viewed_at = attributes[:viewed_at] @created_at = attributes[:created_at] @updated_at = attributes[:updated_at] @direction = attributes[:direction] @conversation_id = attributes[:conversation_id] @origin = attributes[:origin] @object_name = attributes[:object_name] @object_key = attributes[:object_key] @user_id = attributes[:user_id] @created_from_rule_id = attributes[:created_from_rule_id] @body_decoded = attributes[:body_decoded] = attributes[:attachments] else @to = to @name = name @body = body @file = file = end end |
Instance Attribute Details
#attachments ⇒ Object
Returns the value of attribute attachments.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def end |
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def body @body end |
#body_decoded ⇒ Object
Returns the value of attribute body_decoded.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def body_decoded @body_decoded end |
#conversation_id ⇒ Object
Returns the value of attribute conversation_id.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def conversation_id @conversation_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def created_at @created_at end |
#created_from_rule_id ⇒ Object
Returns the value of attribute created_from_rule_id.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def created_from_rule_id @created_from_rule_id end |
#delivered_at ⇒ Object
Returns the value of attribute delivered_at.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def delivered_at @delivered_at end |
#direction ⇒ Object
Returns the value of attribute direction.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def direction @direction end |
#file ⇒ Object
Returns the value of attribute file.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def file @file end |
#from_number ⇒ Object
Returns the value of attribute from_number.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def from_number @from_number end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def name @name end |
#object_key ⇒ Object
Returns the value of attribute object_key.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def object_key @object_key end |
#object_name ⇒ Object
Returns the value of attribute object_name.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def object_name @object_name end |
#origin ⇒ Object
Returns the value of attribute origin.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def origin @origin end |
#tags ⇒ Object
Returns the value of attribute tags.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def end |
#to ⇒ Object
Returns the value of attribute to.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def to @to end |
#to_number ⇒ Object
Returns the value of attribute to_number.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def to_number @to_number end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def updated_at @updated_at end |
#user_id ⇒ Object
Returns the value of attribute user_id.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def user_id @user_id end |
#viewed_at ⇒ Object
Returns the value of attribute viewed_at.
4 5 6 |
# File 'lib/api_objects/message.rb', line 4 def viewed_at @viewed_at end |
Instance Method Details
#send(client) ⇒ Object
42 43 44 |
# File 'lib/api_objects/message.rb', line 42 def send(client) client.post(@url_extension, {message: {to: self.to, name: self.name, text: self.body, file: self.file}, conversation: {tags: self.}}) end |