Method: Glyph::Utils#yaml_dump

Defined in:
lib/glyph/utils.rb

#yaml_dump(file, obj) ⇒ Object

Dumps and serialize an object to a YAML file

Parameters:

  • file (#to_s)

    the file to write to

  • obj (Object)

    the object to serialize

Since:

  • 0.4.0



40
41
42
# File 'lib/glyph/utils.rb', line 40

def yaml_dump(file, obj)
  File.open(file.to_s, 'w+') {|f| f.write obj.to_yaml}
end