Module: YAML

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

Class Method Summary collapse

Class Method Details

.load_path(path) ⇒ Object



6
7
8
9
10
# File 'opal/stdlib/nodejs/yaml.rb', line 6

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