Class: YAML::YamlNode

Class | YAML::YamlNode
In: | yaml/yamlnode.rb
Parent: | Object

YAML Generic Model container

### Methods

new transform

### Included Modules

BaseNode

### Attributes

anchor | [RW] |
kind | [RW] |
type_id | [RW] |
value | [RW] |

### Public Class methods

new( t, v )

[Source]

    # File yaml/yamlnode.rb, line 14
            def initialize( t, v )
                @type_id = t
                if Hash === v
                    @kind = 'map'
                    @value = {}
                    v.each { |k,v|
                        @value[ k.transform ] = [ k, v ]
                    }
                elsif Array === v
                    @kind = 'seq'
                    @value = v
                elsif String === v
                    @kind = 'scalar'
                    @value = v
                end
            end

### Public Instance methods

transform()

Transform this node fully into a native type

[Source]

    # File yaml/yamlnode.rb, line 34
            def transform
                t = nil
                if @value.is_a? Hash
                    t = {}
                    @value.each { |k,v|
                        t[ k ] = v[1].transform
                    }
                elsif @value.is_a? Array
                    t = []
                    @value.each { |v|
                        t.push v.transform
                    }
                else
                    t = @value
                end
                YAML.transfer_method( @type_id, t )
            end

[Validate]