Method: ConfigToolkit::YAMLReader#initialize

Defined in:
lib/configtoolkit/yamlreader.rb

#initialize(stream) ⇒ YAMLReader

Description:

This constructs a YAMLReader instance for stream, where stream either is a file name (a String) or an IO object.

Parameters:

stream

A file name (String) or an IO object. If stream is a file name, then the YAMLReader will open the associated file.



28
29
30
31
32
33
34
# File 'lib/configtoolkit/yamlreader.rb', line 28

def initialize(stream)
  if(stream.class == String)
    @stream = File.open(stream, "r")
  else
    @stream = stream
  end
end