method

to_yaml

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: String
to_yaml( opts = {} ) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/yaml/rubytypes.rb, line 163
        def to_yaml( opts = {} )
                YAML::quick_emit( is_complex_yaml? ? self : nil, opts ) do |out|
            if is_binary_data?
                out.scalar( "tag:yaml.org,2002:binary", [self].pack("m"), :literal )
            elsif to_yaml_properties.empty?
                out.scalar( taguri, self, self =~ /^:/ ? :quote2 : to_yaml_style )
            else
                out.map( taguri, to_yaml_style ) do |map|
                    map.add( 'str', "#{self}" )
                    to_yaml_properties.each do |m|
                        map.add( m, instance_variable_get( m ) )
                    end
                end
            end
        end
        end
Register or log in to add new notes.