Class: Sfp::SasTranslator::GoalVisitor
- Defined in:
- lib/sfp/sas_translator.rb
Overview
Visitor that set goal value of each variable
Instance Method Summary collapse
Methods inherited from Visitor
Constructor Details
This class inherits a constructor from Sfp::SasTranslator::Visitor
Instance Method Details
#set_equals(name, value) ⇒ Object
1619 1620 1621 1622 1623 |
# File 'lib/sfp/sas_translator.rb', line 1619 def set_equals(name, value) value = @types[@vars[name].type][0] if value.is_a?(Hash) and value.isnull value = @root['initial'].at?(value) if value.is_a?(String) and value.isref @vars[name].goal = value end |
#visit(name, value, obj) ⇒ Object
1625 1626 1627 1628 1629 1630 1631 1632 1633 |
# File 'lib/sfp/sas_translator.rb', line 1625 def visit(name, value, obj) return if name[0,1] == '_' raise VariableNotFoundException, 'Variable not found: ' + name if not @vars.has_key?(name) if value.isconstraint self.set_equals(name, value['_value']) if value['_type'] == 'equals' end return true end |