Class: Fwd::Input
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- Fwd::Input
- Extended by:
- Forwardable
- Defined in:
- lib/fwd/input.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#core ⇒ Object
readonly
Returns the value of attribute core.
Instance Method Summary collapse
-
#initialize(core, buffer) ⇒ Input
constructor
A new instance of Input.
-
#receive_data(data) ⇒ Object
When receiving data, concat it to the buffer.
Constructor Details
#initialize(core, buffer) ⇒ Input
Returns a new instance of Input.
9 10 11 12 |
# File 'lib/fwd/input.rb', line 9 def initialize(core, buffer) @core = core @buffer = buffer end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
5 6 7 |
# File 'lib/fwd/input.rb', line 5 def buffer @buffer end |
#core ⇒ Object (readonly)
Returns the value of attribute core.
5 6 7 |
# File 'lib/fwd/input.rb', line 5 def core @core end |
Instance Method Details
#receive_data(data) ⇒ Object
When receiving data, concat it to the buffer
15 16 17 |
# File 'lib/fwd/input.rb', line 15 def receive_data(data) buffer.concat(data) end |