add_ruby_type

add_ruby_type(type_tag, &block) Class Public methods

detect_implicit

detect_implicit(thing) Class Public methods

dump

Psych.dump(o) â string of yamlPsych.dump(o, options) â string of yamlPsych.dump(o, io) â io object passed inPsych.dump(o, io, options) â io object passed in Class Public methods Dump Ruby object o to a YAML string. Optional options may be passed in to control the output format. If an IO object is passed in, the YAML will be dumped to that IO object. Example: # Dump an array, get back a YAML string Psych.dump(['a', 'b']) # => "---\n- a\n- b\n" #

dump_stream

dump_stream(*objects) Class Public methods Dump a list of objects as separate documents to a document stream. Example: Psych.dump_stream("foo\n ", {}) # => "--- ! \"foo\\n \"\n--- {}\n"

libyaml_version

Psych.libyaml_version Class Public methods Returns the version of libyaml being used

load

load(yaml, filename = nil) Class Public methods Load yaml in to a Ruby data structure. If multiple documents are provided, the object contained in the first document will be returned. filename will be used in the exception message if any exception is raised while parsing. Raises a Psych::SyntaxError when a YAML syntax error is detected. Example: Psych.load("--- a") # => 'a' Psych.load("---\n - a\n - b") # => ['a', 'b'] begin Psych.load("--- `", "file.txt") r

load_documents

load_documents(yaml, &block) Class Public methods This method is deprecated, use ::load_stream instead.

load_file

load_file(filename) Class Public methods Load the document contained in filename. Returns the yaml contained in filename as a ruby object

load_stream

load_stream(yaml, filename = nil) Class Public methods Load multiple documents given in yaml. Returns the parsed documents as a list. If a block is given, each document will be converted to ruby and passed to the block during parsing Example: Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar'] list = [] Psych.load_stream("--- foo\n...\n--- bar\n...") do |ruby| list << ruby end list # => ['foo', 'bar']

object_maker

object_maker(klass, hash) Class Public methods