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
10
11
12
13
# File 'lib/yarb.rb', line 5

def self.load(read_or_string, options = {:binding => TOPLEVEL_BINDING})
  pass_binding = options[:binding]

  if read_or_string.respond_to? :read 
    YAML::load(ERB.new(read_or_string.read).result(pass_binding)) 
  else
    YAML::load(ERB.new(read_or_string).result(pass_binding))
  end
end