Class: AssetsBooster::Merger::Base
- Inherits:
-
Object
- Object
- AssetsBooster::Merger::Base
- Defined in:
- lib/assets_booster/merger/base.rb
Instance Attribute Summary collapse
-
#assets ⇒ Object
Returns the value of attribute assets.
Instance Method Summary collapse
-
#initialize(sources) ⇒ Base
constructor
A new instance of Base.
- #load_source(source) ⇒ Object
- #mtime ⇒ Object
Constructor Details
#initialize(sources) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 |
# File 'lib/assets_booster/merger/base.rb', line 6 def initialize(sources) self.assets = [] sources.each do |source| load_source(source) end end |
Instance Attribute Details
#assets ⇒ Object
Returns the value of attribute assets.
4 5 6 |
# File 'lib/assets_booster/merger/base.rb', line 4 def assets @assets end |
Instance Method Details
#load_source(source) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/assets_booster/merger/base.rb', line 17 def load_source(source) assets << { :source => source, :css => File.read(source), } end |
#mtime ⇒ Object
13 14 15 |
# File 'lib/assets_booster/merger/base.rb', line 13 def mtime assets.map{ |asset| File.mtime(asset[:source]) }.max end |