Class: Dizby::SelfPipe

Inherits:
Struct
  • Object
show all
Defined in:
lib/dizby/utility/self_pipe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#readObject

Returns the value of attribute read

Returns:

  • (Object)

    the current value of read



5
6
7
# File 'lib/dizby/utility/self_pipe.rb', line 5

def read
  @read
end

#writeObject

Returns the value of attribute write

Returns:

  • (Object)

    the current value of write



5
6
7
# File 'lib/dizby/utility/self_pipe.rb', line 5

def write
  @write
end

Instance Method Details

#close_read



6
7
8
# File 'lib/dizby/utility/self_pipe.rb', line 6

def close_read
  read.close if read && !read.closed?
end

#close_write



10
11
12
# File 'lib/dizby/utility/self_pipe.rb', line 10

def close_write
  write.close if write && !write.closed?
end