Class: Hulk::BundleCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/hulk/bundle_collection.rb

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ BundleCollection

Returns a new instance of BundleCollection.



6
7
8
9
10
11
12
# File 'lib/hulk/bundle_collection.rb', line 6

def initialize(type)
  @bundle_class = {
    :css => Hulk::CssBundle,
    :js => Hulk::JsBundle,
  }[type]
  @bundles = Hash.new {|h, k| h[k] = @bundle_class.new(k)}
end

Instance Method Details

#[](name) ⇒ Object



14
15
16
# File 'lib/hulk/bundle_collection.rb', line 14

def [](name)
  @bundles[name]
end

#compile!Object



18
19
20
21
22
# File 'lib/hulk/bundle_collection.rb', line 18

def compile!
  @bundles.each do |_, bundle|
    bundle.compile!
  end
end