Sha256: 6d4872e126788f4050d007ab1611895cef1f6dae3f564119f4762d50236fd177

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

require "yml_reader/version"

module YmlReader

  #
  # Set the directory to use when reading yml files
  #
  def yml_directory=(directory)
    @yml_directory = directory
  end

  #
  # Returns the directory to be used when reading yml files
  #
  def yml_directory
    return @yml_directory if @yml_directory
    return default_directory if self.respond_to? :default_directory
    nil
  end

  #
  # Loads the requested file.  It will look for the file in the
  # directory specified by a call to the yml_directory= method.
  #
  def load(filename)
    @yml = YAML.load_file "#{yml_directory}/#{filename}"
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yml_reader-0.2 lib/yml_reader.rb