class Sfp::Visitor::SfpGenerator

Public Class Methods

new(root) click to toggle source
# File lib/sfp/visitors.rb, line 75
def initialize(root)
        @root = root
end

Public Instance Methods

visit(name, value, parent) click to toggle source
# File lib/sfp/visitors.rb, line 79
def visit(name, value, parent)
        if value.is_a?(Hash)
                value['_parent'] = parent
                value['_self'] = name
                if not value.has_key?('_context')
                        value['_context'] = 'object'
                        if value.has_key?('_isa')
                        else
                                value['_isa'] = '$.Object'
                        end
                end
                Sfp::Helper.expand_object(value, @root) if value.isobject
        end
        return true
end