Class: DaedalSL::BlockQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/daedal-sl/block_query.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, options)
  @parent = parent
  @base = @query_type.new(options)
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

#baseObject (readonly)

Returns the value of attribute base.



4
5
6
# File 'lib/daedal-sl/block_query.rb', line 4

def base
  @base
end

#parentObject (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, options, &block)
  result = new(parent, options)
  if block
    result.instance_eval(&block)
  end
  result.base
end