Module: YARB

Defined in:
lib/yarb.rb

Class Method Summary collapse

Class Method Details

.load(read_or_string, options = {:binding => TOPLEVEL_BINDING}) ⇒ Object



5
6
7
8
9
# File 'lib/yarb.rb', line 5

def self.load(read_or_string, options = {:binding => TOPLEVEL_BINDING})
  read_or_string = (read_or_string.respond_to?(:read) ? read_or_string.read : read_or_string.to_s)
 
  YAML::load(ERB.new(read_or_string).result(options[:binding]))
end