Class: RIO::IOH::Dir

Inherits:
Base show all
Extended by:
Forwardable
Defined in:
lib/rio/ioh.rb

Instance Attribute Summary

Attributes inherited from Base

#ios

Instance Method Summary collapse

Methods inherited from Base

#callstr, #handle, #initialize, #initialize_copy, #open?

Constructor Details

This class inherits a constructor from RIO::IOH::Base

Instance Method Details

#closeObject



137
138
139
140
141
142
143
# File 'lib/rio/ioh.rb', line 137

def close
  #p "#{callstr('close')} ios=#{@ios}"
  unless @ios.nil?
    @ios.close
    @ios = nil
  end
end

#closed?Boolean

Returns:

  • (Boolean)


144
# File 'lib/rio/ioh.rb', line 144

def closed?() @ios.nil? end

#each(&block) ⇒ Object



145
146
147
148
149
# File 'lib/rio/ioh.rb', line 145

def each(&block)
  while filename = handle.read
    yield filename
  end
end

#each0(&block) ⇒ Object



150
151
152
153
154
# File 'lib/rio/ioh.rb', line 150

def each0(&block)
  handle.each { |filename|
    yield filename
  }
end