Class: Kodo::Channels::Base
- Inherits:
-
Object
- Object
- Kodo::Channels::Base
- Defined in:
- lib/kodo/channels/base.rb
Instance Attribute Summary collapse
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
Instance Method Summary collapse
- #connect! ⇒ Object
- #disconnect! ⇒ Object
-
#initialize(channel_id:) ⇒ Base
constructor
A new instance of Base.
-
#poll ⇒ Object
Check for new messages.
- #running? ⇒ Boolean
-
#send_message(message) ⇒ Object
Send a message through this channel.
Constructor Details
#initialize(channel_id:) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'lib/kodo/channels/base.rb', line 8 def initialize(channel_id:) @channel_id = channel_id @running = false end |
Instance Attribute Details
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
6 7 8 |
# File 'lib/kodo/channels/base.rb', line 6 def channel_id @channel_id end |
Instance Method Details
#connect! ⇒ Object
13 14 15 |
# File 'lib/kodo/channels/base.rb', line 13 def connect! raise NotImplementedError end |
#disconnect! ⇒ Object
17 18 19 |
# File 'lib/kodo/channels/base.rb', line 17 def disconnect! @running = false end |
#poll ⇒ Object
Check for new messages. Returns ArrayKodo::Message
22 23 24 |
# File 'lib/kodo/channels/base.rb', line 22 def poll raise NotImplementedError end |
#running? ⇒ Boolean
31 32 33 |
# File 'lib/kodo/channels/base.rb', line 31 def running? @running end |
#send_message(message) ⇒ Object
Send a message through this channel
27 28 29 |
# File 'lib/kodo/channels/base.rb', line 27 def () raise NotImplementedError end |