Class: Brief::Data::Queryable

Inherits:
Object
  • Object
show all
Defined in:
lib/brief/data.rb

Instance Method Summary collapse

Constructor Details

#initialize(array) ⇒ Queryable

Returns a new instance of Queryable.



4
5
6
# File 'lib/brief/data.rb', line 4

def initialize(array)
  @array = Array(array)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



12
13
14
# File 'lib/brief/data.rb', line 12

def method_missing(meth, *args, &block)
  @array.send(meth,*args,&block)
end

Instance Method Details

#where(*args, &block) ⇒ Object



8
9
10
# File 'lib/brief/data.rb', line 8

def where(*args, &block)
  Brief::DocumentMapper::Query.new(@array).send(:where, *args)
end