Class: ActiveMocker::Relation
Instance Method Summary
collapse
Methods included from Queries
#all, #average, #count, #delete_all, #find, #find_by, #find_by!, #find_or_create_by, #find_or_initialize_by, #first_or_create, #first_or_create!, #first_or_initialize, #limit, #maximum, #minimum, #none, #order, #reverse_order, #sum, #update, #update_all, #where
Methods inherited from Collection
#<<, #==, #blank?, #each, #hash, #to_a, #to_ary
Constructor Details
#initialize(collection = []) ⇒ Relation
7
8
9
10
|
# File 'lib/active_mocker/mock/relation.rb', line 7
def initialize(collection = [])
super
@from_limit = false
end
|
Instance Method Details
#from_limit? ⇒ Boolean
18
19
20
|
# File 'lib/active_mocker/mock/relation.rb', line 18
def from_limit?
@from_limit
end
|
#inspect ⇒ Object
12
13
14
15
16
|
# File 'lib/active_mocker/mock/relation.rb', line 12
def inspect
entries = to_a.take(11).map!(&:inspect)
entries[10] = "..." if entries.size == 11
"#<#{name} [#{entries.join(", ")}]>"
end
|
#name ⇒ Object
22
23
24
|
# File 'lib/active_mocker/mock/relation.rb', line 22
def name
self.class.name
end
|