Class: Factbase::Syntax
- Inherits:
-
Object
- Object
- Factbase::Syntax
- Defined in:
- lib/factbase/syntax.rb
Overview
Syntax.
This is an internal class, it is not supposed to be instantiated directly.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
-
#initialize(query) ⇒ Syntax
constructor
Ctor.
-
#to_term ⇒ Term
Convert it to a term.
Constructor Details
#initialize(query) ⇒ Syntax
Ctor.
38 39 40 |
# File 'lib/factbase/syntax.rb', line 38 def initialize(query) @query = query end |
Instance Method Details
#to_term ⇒ Term
Convert it to a term.
44 45 46 47 48 49 50 |
# File 'lib/factbase/syntax.rb', line 44 def to_term build.simplify rescue StandardError => e err = "#{e.} in #{@query}" err = "#{err}, tokens: #{@tokens}" unless @tokens.nil? raise err end |