Class: ChatSDK::Message
- Inherits:
-
Object
- Object
- ChatSDK::Message
- Defined in:
- lib/chat_sdk/message.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#platform ⇒ Object
readonly
Returns the value of attribute platform.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(id:, text:, author:, thread_id:, channel_id:, platform:, attachments: [], raw: nil, timestamp: nil) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(id:, text:, author:, thread_id:, channel_id:, platform:, attachments: [], raw: nil, timestamp: nil) ⇒ Message
Returns a new instance of Message.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/chat_sdk/message.rb', line 8 def initialize(id:, text:, author:, thread_id:, channel_id:, platform:, attachments: [], raw: nil, timestamp: nil) @id = id @text = text @author = @thread_id = thread_id @channel_id = channel_id @platform = platform @attachments = @raw = raw @timestamp = end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def @attachments end |
#author ⇒ Object (readonly)
Returns the value of attribute author.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def @author end |
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def channel_id @channel_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def id @id end |
#platform ⇒ Object (readonly)
Returns the value of attribute platform.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def platform @platform end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def raw @raw end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def text @text end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def thread_id @thread_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/chat_sdk/message.rb', line 5 def @timestamp end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
21 22 23 |
# File 'lib/chat_sdk/message.rb', line 21 def ==(other) other.is_a?(Message) && id == other.id && platform == other.platform end |
#hash ⇒ Object
26 27 28 |
# File 'lib/chat_sdk/message.rb', line 26 def hash [id, platform].hash end |