Class: Izanami::Channel::Input
- Inherits:
-
Object
- Object
- Izanami::Channel::Input
- Defined in:
- lib/izanami/channel.rb
Overview
Handles the input written to the channel.
Instance Method Summary collapse
-
#<<(payload) ⇒ Object
(also: #add)
Add new content to the channel.
-
#close ⇒ String
Closes the channel.
-
#initialize(mapper, id) ⇒ Input
constructor
A new instance of Input.
-
#to_s ⇒ String
(also: #read)
Content that has been written.
Constructor Details
#initialize(mapper, id) ⇒ Input
Returns a new instance of Input.
24 25 26 27 28 |
# File 'lib/izanami/channel.rb', line 24 def initialize(mapper, id) @mapper = mapper @id = id @content = [] end |
Instance Method Details
#<<(payload) ⇒ Object Also known as: add
Add new content to the channel.
33 34 35 36 |
# File 'lib/izanami/channel.rb', line 33 def <<(payload) @mapper.publish(@id, payload) @content << payload end |