Class: WebResourceBundler::Filters::BundleFilter::Filter
- Inherits:
-
WebResourceBundler::Filters::BaseFilter
- Object
- WebResourceBundler::Filters::BaseFilter
- WebResourceBundler::Filters::BundleFilter::Filter
- Defined in:
- lib/web_resource_bundler/filters/bundle_filter.rb
Instance Attribute Summary
Attributes inherited from WebResourceBundler::Filters::BaseFilter
Instance Method Summary collapse
- #apply!(block_data) ⇒ Object
-
#initialize(settings, file_manager) ⇒ Filter
constructor
A new instance of Filter.
Methods inherited from WebResourceBundler::Filters::BaseFilter
Constructor Details
#initialize(settings, file_manager) ⇒ Filter
Returns a new instance of Filter.
9 10 11 12 |
# File 'lib/web_resource_bundler/filters/bundle_filter.rb', line 9 def initialize(settings, file_manager) super(settings, file_manager) @packager = ResourcePackager.new(@settings, @file_manager) end |
Instance Method Details
#apply!(block_data) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/web_resource_bundler/filters/bundle_filter.rb', line 14 def apply!(block_data) new_files = [] new_files << create_css_bundle(block_data.styles) if block_data.styles.any? new_files << create_js_bundle(block_data.scripts) if block_data.scripts.any? block_data.files = new_files block_data end |