Module: YAML

Defined in:
opal/stdlib/nodejs/yaml.rb

Class Method Summary collapse

Class Method Details

.load_path(path) ⇒ Object



8
9
10
11
12
# File 'opal/stdlib/nodejs/yaml.rb', line 8

def self.load_path path
  loaded = `__yaml__.safeLoad(#{File}.__fs__.readFileSync(#{path}, 'utf8'))`
  loaded = Hash.new(loaded) if native?(loaded)
  loaded
end