Module: Factbase::Term::Debug

Included in:
Factbase::Term
Defined in:
lib/factbase/terms/debug.rb

Overview

Debug terms.

Author

Yegor Bugayenko ([email protected])

Copyright

Copyright © 2024 Yegor Bugayenko

License

MIT

Instance Method Summary collapse

Instance Method Details

#traced(fact, maps) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/factbase/terms/debug.rb', line 31

def traced(fact, maps)
  assert_args(1)
  t = @operands[0]
  raise "A term expected, but '#{t}' provided" unless t.is_a?(Factbase::Term)
  r = t.evaluate(fact, maps)
  puts "#{self} -> #{r}"
  r
end