Class: Factbase::Undef
Overview
- License
-
MIT
Instance Method Summary collapse
-
#evaluate(_fact, _maps, _fb) ⇒ Boolean
Evaluate term on a fact.
-
#initialize(operands) ⇒ Undef
constructor
Constructor.
Methods included from TermShared
Constructor Details
#initialize(operands) ⇒ Undef
Constructor.
14 15 16 17 |
# File 'lib/factbase/terms/undef.rb', line 14 def initialize(operands) super() @operands = operands end |
Instance Method Details
#evaluate(_fact, _maps, _fb) ⇒ Boolean
Evaluate term on a fact.
24 25 26 27 28 29 30 31 32 |
# File 'lib/factbase/terms/undef.rb', line 24 def evaluate(_fact, _maps, _fb) assert_args(1) fn = @operands[0] raise "A symbol expected as first argument of 'undef'" unless fn.is_a?(Symbol) if Factbase::Term.private_instance_methods(false).include?(fn) Factbase::Term.class_eval("undef :#{fn}", __FILE__, __LINE__ - 1) # undef :foo end true end |