Module: Audrey::Object::Searchable

Included in:
Custom
Defined in:
lib/audrey.rb

Overview

Audrey::Object::Searchable

Instance Method Summary collapse

Instance Method Details

#count(opts = {}) ⇒ Object


count



1720
1721
1722
# File 'lib/audrey.rb', line 1720

def count(opts={})
	return prepare_query(opts).count
end

#each(opts = {}) ⇒ Object


each



1707
1708
1709
1710
1711
# File 'lib/audrey.rb', line 1707

def each(opts={})
	prepare_query(opts).each do |object|
		yield object
	end
end

#first(opts = {}) ⇒ Object


first



1731
1732
1733
1734
1735
# File 'lib/audrey.rb', line 1731

def first(opts={})
	prepare_query(opts).each do |object|
		return object
	end
end

#sample(opts = {}) ⇒ Object


sample, samples



1744
1745
1746
1747
# File 'lib/audrey.rb', line 1744

def sample(opts={})
	query = prepare_query(opts)
	return query.sample
end

#samples(c, opts = {}) ⇒ Object



1749
1750
1751
1752
# File 'lib/audrey.rb', line 1749

def samples(c, opts={})
	query = prepare_query(opts)
	return query.samples(c)
end