Class: DaedalSL::BlockQuery
- Inherits:
-
Object
- Object
- DaedalSL::BlockQuery
- Defined in:
- lib/daedal-sl/block_query.rb
Direct Known Subclasses
AndFilter, BoolFilter, BoolQuery, DisMaxQuery, NestedBoolFilter, NestedBoolQuery, NestedDisMaxQuery, OrFilter
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(parent, options) ⇒ BlockQuery
constructor
A new instance of BlockQuery.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(parent, options) ⇒ BlockQuery
Returns a new instance of BlockQuery.
6 7 8 9 |
# File 'lib/daedal-sl/block_query.rb', line 6 def initialize(parent, ) @parent = parent @base = @query_type.new() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
11 12 13 |
# File 'lib/daedal-sl/block_query.rb', line 11 def method_missing(method, *args, &block) @parent.send(method, *args, &block) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
4 5 6 |
# File 'lib/daedal-sl/block_query.rb', line 4 def base @base end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
3 4 5 |
# File 'lib/daedal-sl/block_query.rb', line 3 def parent @parent end |
Class Method Details
.build(parent, options, &block) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/daedal-sl/block_query.rb', line 16 def build(parent, , &block) result = new(parent, ) if block result.instance_eval(&block) end result.base end |