Class: ActiveData::Model::Associations::Collection::Proxy

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

Instance Method Summary collapse

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

#inspectObject



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



17
18
19
# File 'lib/active_data/model/associations/collection/proxy.rb', line 17

def to_ary
  dup
end