Class: ActiveData::Model::Associations::Collection::Proxy
- Inherits:
-
Object
- Object
- ActiveData::Model::Associations::Collection::Proxy
- Includes:
- Enumerable
- Defined in:
- lib/active_data/model/associations/collection/proxy.rb
Direct Known Subclasses
Embedded, PersistenceAdapters::ActiveRecord::ReferencedProxy
Instance Method Summary collapse
-
#initialize(association) ⇒ Proxy
constructor
A new instance of Proxy.
- #inspect ⇒ Object
- #to_ary ⇒ Object (also: #to_a)
Constructor Details
#initialize(association) ⇒ Proxy
Returns a new instance of Proxy.
13 14 15 |
# File 'lib/active_data/model/associations/collection/proxy.rb', line 13 def initialize(association) @association = association end |
Instance Method Details
#inspect ⇒ Object
22 23 24 25 26 27 |
# File 'lib/active_data/model/associations/collection/proxy.rb', line 22 def inspect entries = target.take(10).map!(&:inspect) entries[10] = '...' if target.size > 10 "#<#{self.class.name.demodulize} [#{entries.join(', ')}]>" end |
#to_ary ⇒ Object Also known as: to_a
17 18 19 |
# File 'lib/active_data/model/associations/collection/proxy.rb', line 17 def to_ary dup end |