Class: Fwd::Input

Inherits:
EM::Connection
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fwd/input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(core, buffer) ⇒ Input

Returns a new instance of Input.

Parameters:



9
10
11
12
# File 'lib/fwd/input.rb', line 9

def initialize(core, buffer)
  @core   = core
  @buffer = buffer
end

Instance Attribute Details

#bufferObject (readonly)

Returns the value of attribute buffer.



5
6
7
# File 'lib/fwd/input.rb', line 5

def buffer
  @buffer
end

#coreObject (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