Method: Fast::File#read

Defined in:
lib/fast/file.rb

#read(path = nil, &block) ⇒ Object

Returns the contents of the file, all at once



120
121
122
123
124
125
126
127
128
129
# File 'lib/fast/file.rb', line 120

def read path = nil, &block
  @path = normalize path if path
  unless block
    ::File.read @path
  else
    ::File.open @path, "r" do |the_file|
      block.call the_file
    end
  end
end