Module: Exposant::Collection

Includes:
Enumerable
Defined in:
lib/exposant/concerns/collection.rb

Instance Method Summary collapse

Instance Method Details

#eachObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/exposant/concerns/collection.rb', line 5

def each
  return enum_for(:each) unless block_given?

  super do |obj|
    exposant = obj.exposant(self.class.exposant_variant, self.class.exposant_type)
    exposant.contextualize(context) if contextualized?

    yield exposant
  end
end