Class: Granite::Form::Model::Associations::Collection::Proxy

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/granite/form/model/associations/collection/proxy.rb

Instance Method Summary collapse

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

#inspectObject



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_aryObject Also known as: to_a



18
19
20
# File 'lib/granite/form/model/associations/collection/proxy.rb', line 18

def to_ary
  dup
end