Class: SqlTools::Predicate::Builder
- Inherits:
-
Object
- Object
- SqlTools::Predicate::Builder
- Defined in:
- lib/sql_tools/predicate.rb
Instance Method Summary collapse
- #build(predicate) ⇒ Object
-
#initialize(query) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(query) ⇒ Builder
Returns a new instance of Builder.
9 10 11 |
# File 'lib/sql_tools/predicate.rb', line 9 def initialize(query) @query = query end |
Instance Method Details
#build(predicate) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/sql_tools/predicate.rb', line 13 def build(predicate) case predicate when Predicate::Binary predicate.left = build(predicate.left) predicate.right = build(predicate.right) predicate when TreeStand::Node type_from_node(predicate) else raise "Unknown predicate: #{predicate}" end end |