Class: Query
- Inherits:
-
Object
- Object
- Query
- Defined in:
- lib/eno.rb
Instance Method Summary collapse
- #as(sym) ⇒ Object
-
#initialize(**ctx, &block) ⇒ Query
constructor
A new instance of Query.
- #mutate(&block) ⇒ Object
- #to_sql(**ctx) ⇒ Object
- #where(&block) ⇒ Object
Constructor Details
#initialize(**ctx, &block) ⇒ Query
Returns a new instance of Query.
370 371 372 373 |
# File 'lib/eno.rb', line 370 def initialize(**ctx, &block) @ctx = ctx @block = block end |
Instance Method Details
#mutate(&block) ⇒ Object
392 393 394 395 396 397 398 |
# File 'lib/eno.rb', line 392 def mutate(&block) old_block = @block Query.new(@ctx) { instance_eval(&old_block) instance_eval(&block) } end |