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) ⇒ Input

Returns a new instance of Input.

Parameters:

  • core (Fwd)
  • opts (Hash)

    additional opts



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

def initialize(core)
  @core = core
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

#post_initObject



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