Class: Perpetuity::MongoDB::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/perpetuity/mongodb/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Query

Returns a new instance of Query.



6
7
8
# File 'lib/perpetuity/mongodb/query.rb', line 6

def initialize &block
  @query = block.call(self)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(missing_method) ⇒ Object



14
15
16
# File 'lib/perpetuity/mongodb/query.rb', line 14

def method_missing missing_method
  QueryAttribute.new missing_method
end

Instance Method Details

#to_dbObject



10
11
12
# File 'lib/perpetuity/mongodb/query.rb', line 10

def to_db
  @query.to_db
end