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) ⇒ Input
constructor
A new instance of Input.
- #post_init ⇒ Object
-
#receive_data(data) ⇒ Object
When receiving data, concat it to the buffer.
Constructor Details
#initialize(core) ⇒ Input
Returns a new instance of Input.
9 10 11 |
# File 'lib/fwd/input.rb', line 9 def initialize(core) @core = core 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
#post_init ⇒ Object
13 14 15 |
# File 'lib/fwd/input.rb', line 13 def post_init @buffer = Fwd::Buffer.new(core) end |
#receive_data(data) ⇒ Object
When receiving data, concat it to the buffer
18 19 20 |
# File 'lib/fwd/input.rb', line 18 def receive_data(data) buffer.concat(data) end |