Class: Granite::Form::Model::Associations::Collection::Proxy
- Inherits:
-
Object
- Object
- Granite::Form::Model::Associations::Collection::Proxy
- Includes:
- Enumerable
- Defined in:
- lib/granite/form/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.
14 15 16 |
# File 'lib/granite/form/model/associations/collection/proxy.rb', line 14 def initialize(association) @association = association end |
Instance Method Details
#inspect ⇒ Object
24 25 26 27 28 29 |
# File 'lib/granite/form/model/associations/collection/proxy.rb', line 24 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
18 19 20 |
# File 'lib/granite/form/model/associations/collection/proxy.rb', line 18 def to_ary dup end |