Class: ScriptCore::ServiceChannel

Inherits:
Object
  • Object
show all
Defined in:
lib/script_core/service_channel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(in_writer, out_reader) ⇒ ServiceChannel

Returns a new instance of ServiceChannel.



7
8
9
10
# File 'lib/script_core/service_channel.rb', line 7

def initialize(in_writer, out_reader)
  @in_writer = in_writer
  @out_reader = out_reader
end

Instance Attribute Details

#in_writerObject (readonly)

Returns the value of attribute in_writer.



5
6
7
# File 'lib/script_core/service_channel.rb', line 5

def in_writer
  @in_writer
end

#out_readerObject (readonly)

Returns the value of attribute out_reader.



5
6
7
# File 'lib/script_core/service_channel.rb', line 5

def out_reader
  @out_reader
end

Instance Method Details

#read(*args) ⇒ Object



19
20
21
# File 'lib/script_core/service_channel.rb', line 19

def read(*args)
  out_reader.read(*args)
end

#write(buffer) ⇒ Object



12
13
14
15
16
17
# File 'lib/script_core/service_channel.rb', line 12

def write(buffer)
  in_writer.write(buffer)
  nil
rescue Errno::EPIPE
  nil
end