method
to_yaml
v1_8_6_287 -
Show latest stable
- Class:
Array
to_yaml( opts = {} )public
No documentation available.
# File lib/yaml/rubytypes.rb, line 106
def to_yaml( opts = {} )
YAML::quick_emit( self, opts ) do |out|
out.seq( taguri, to_yaml_style ) do |seq|
each do |x|
seq.add( x )
end
end
end
end 1Note
Using YAML
=== YAML library must be required.
==== Example to display an array as yaml formatted output
require 'yaml'
puts [100, [99, 98, 97], 96, 95].to_yaml