Class: Wongi::Engine::DSL::Clause::Neg
- Defined in:
- lib/wongi-engine/dsl/clause/fact.rb
Instance Attribute Summary collapse
-
#unsafe ⇒ Object
readonly
Returns the value of attribute unsafe.
Attributes inherited from Has
#object, #predicate, #subject, #time
Instance Method Summary collapse
Methods inherited from Has
Methods included from CoreExt
Constructor Details
This class inherits a constructor from Wongi::Engine::DSL::Clause::Has
Instance Attribute Details
#unsafe ⇒ Object (readonly)
Returns the value of attribute unsafe.
49 50 51 |
# File 'lib/wongi-engine/dsl/clause/fact.rb', line 49 def unsafe @unsafe end |
Instance Method Details
#compile(context) ⇒ Object
50 51 52 53 54 |
# File 'lib/wongi-engine/dsl/clause/fact.rb', line 50 def compile context tests, assignment = parse_variables(context) raise DefinitionError.new("Negative matches may not introduce new variables: #{assignment.variables}") unless assignment.root? context.tap { |c| c.neg_node(self, tests, unsafe) } end |
#inspect ⇒ Object
56 57 58 |
# File 'lib/wongi-engine/dsl/clause/fact.rb', line 56 def inspect "<-#{subject.inspect} #{predicate.inspect} #{object.inspect}>" end |