Class: ActiveMocker::Relation
- Inherits:
-
Collection
- Object
- Collection
- ActiveMocker::Relation
- Includes:
- MockableMethod, Queries
- Defined in:
- lib/active_mocker/mock/relation.rb
Direct Known Subclasses
Instance Method Summary collapse
- #from_limit? ⇒ Boolean
-
#initialize(collection = []) ⇒ Relation
constructor
A new instance of Relation.
- #inspect ⇒ Object
- #name ⇒ Object
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
Returns a new instance of 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 |