Mega Code Archive
Categories
/
Ruby
/
File Directory
Create class to wrap File exist and File new method
class MyFile attr_reader :handle def initialize(filename) if File.exist?(filename) @handle = File.new(filename, "r") else return false end end end