Class: Eson::Search::Queries::QueriesArray

Inherits:
Array
  • Object
show all
Includes:
Parametrized, QueryMethods
Defined in:
lib/eson/search/queries.rb

Instance Attribute Summary

Attributes included from Parametrized

#args

Instance Method Summary collapse

Methods included from Parametrized

#param

Constructor Details

#initialize(args) ⇒ QueriesArray

Returns a new instance of QueriesArray.



16
17
18
19
# File 'lib/eson/search/queries.rb', line 16

def initialize(args)
  self.args = args
  instance_exec(self, &Proc.new) if block_given?
end

Instance Method Details

#queriesObject



12
13
14
# File 'lib/eson/search/queries.rb', line 12

def queries
  self
end

#to_query_hashObject



21
22
23
24
25
26
27
# File 'lib/eson/search/queries.rb', line 21

def to_query_hash
  if length == 1
    first.to_query_hash
  else
    map(&:to_query_hash)
  end
end