Class: ActiveMapper::Adapter::Memory::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/active_mapper/adapter/memory/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Query

Returns a new instance of Query.



8
9
10
# File 'lib/active_mapper/adapter/memory/query.rb', line 8

def initialize(&block)
  @block = block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



16
17
18
# File 'lib/active_mapper/adapter/memory/query.rb', line 16

def method_missing(name, *args, &block)
  Attribute.new(name)
end

Instance Method Details

#to_procObject



12
13
14
# File 'lib/active_mapper/adapter/memory/query.rb', line 12

def to_proc
  @block ? @block.call(self).to_proc : proc { true }
end