Class: ChatSDK::Channel
- Inherits:
-
Object
- Object
- ChatSDK::Channel
- Defined in:
- lib/chat_sdk/channel.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#chat ⇒ Object
readonly
Returns the value of attribute chat.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(id:, adapter:, chat:) ⇒ Channel
constructor
A new instance of Channel.
- #post(content) ⇒ Object
- #thread(thread_id) ⇒ Object
Constructor Details
#initialize(id:, adapter:, chat:) ⇒ Channel
Returns a new instance of Channel.
7 8 9 10 11 |
# File 'lib/chat_sdk/channel.rb', line 7 def initialize(id:, adapter:, chat:) @id = id @adapter = adapter @chat = chat end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
5 6 7 |
# File 'lib/chat_sdk/channel.rb', line 5 def adapter @adapter end |
#chat ⇒ Object (readonly)
Returns the value of attribute chat.
5 6 7 |
# File 'lib/chat_sdk/channel.rb', line 5 def chat @chat end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/chat_sdk/channel.rb', line 5 def id @id end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
22 23 24 |
# File 'lib/chat_sdk/channel.rb', line 22 def ==(other) other.is_a?(Channel) && id == other.id end |
#hash ⇒ Object
27 28 29 |
# File 'lib/chat_sdk/channel.rb', line 27 def hash id.hash end |
#post(content) ⇒ Object
13 14 15 16 |
# File 'lib/chat_sdk/channel.rb', line 13 def post(content) = PostableMessage.from(content) adapter.(channel_id: id, message: ) end |