Class: Sfp::Visitor::SfpGenerator
- Inherits:
-
Object
- Object
- Sfp::Visitor::SfpGenerator
- Defined in:
- lib/sfp/visitors.rb
Instance Method Summary collapse
-
#initialize(root) ⇒ SfpGenerator
constructor
A new instance of SfpGenerator.
- #visit(name, value, parent) ⇒ Object
Constructor Details
#initialize(root) ⇒ SfpGenerator
Returns a new instance of SfpGenerator.
75 76 77 |
# File 'lib/sfp/visitors.rb', line 75 def initialize(root) @root = root end |
Instance Method Details
#visit(name, value, parent) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# 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.(value, @root) if value.isobject end return true end |