Class: Middleman::Presentation::AssetList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/middleman-presentation-core/asset_list.rb

Overview

List of assets

The class takes a list of components and generates a list of assets from this. It also includes ‘Enumerable`

Instance Method Summary collapse

Constructor Details

#initialize(components, creator: Asset, store: AssetStore.new) ⇒ AssetList

Returns a new instance of AssetList.



17
18
19
20
21
22
23
# File 'lib/middleman-presentation-core/asset_list.rb', line 17

def initialize(components, creator: Asset, store: AssetStore.new)
  @components = components
  @store     = store
  @creator   = creator

  read_in_assets
end

Instance Method Details

#each { ... } ⇒ Object

Iternate over each component and execute block

Yields:

  • Block which is executed for each component



29
30
31
# File 'lib/middleman-presentation-core/asset_list.rb', line 29

def each(&block)
  to_a.each(&block)
end