class CabezaDeTermo::Assets::Collector
This object collects the assets from both an included asset and the assets included by a required bundle.
Public Class Methods
new()
click to toggle source
Initialize the instance
# File lib/cabeza-de-termo/assets/collectors/collector.rb, line 8 def initialize @assets = [] end
Public Instance Methods
assets()
click to toggle source
Answer the collected assets. The answer is a collection of strings.
# File lib/cabeza-de-termo/assets/collectors/collector.rb, line 13 def assets @assets end
bundle_named(bundle_name)
click to toggle source
Answer the bundle named bundle_name.
# File lib/cabeza-de-termo/assets/collectors/collector.rb, line 31 def bundle_named(bundle_name) Library.bundle_named bundle_name end
include(asset)
click to toggle source
Add the asset to the collected assets. Ignore the asset if it was already included.
# File lib/cabeza-de-termo/assets/collectors/collector.rb, line 19 def include(asset) return if @assets.include?(asset) @assets << asset end
require(bundle_name)
click to toggle source
Add the assets included in the bundle named bundle_name.
# File lib/cabeza-de-termo/assets/collectors/collector.rb, line 25 def require(bundle_name) bundle_named(bundle_name) .collect_assets_with(self) end