Class: Rack::Bundle::JSBundle
- Inherits:
-
Object
- Object
- Rack::Bundle::JSBundle
- Defined in:
- lib/rack/bundle/js_bundle.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#hash ⇒ Object
Returns the value of attribute hash.
Instance Method Summary collapse
- #==(bundle) ⇒ Object
- #extension ⇒ Object
-
#initialize(*files) ⇒ JSBundle
constructor
A new instance of JSBundle.
Constructor Details
#initialize(*files) ⇒ JSBundle
Returns a new instance of JSBundle.
5 6 7 8 |
# File 'lib/rack/bundle/js_bundle.rb', line 5 def initialize *files @contents = files.join ';' @hash = MD5.new(@contents).to_s end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
4 5 6 |
# File 'lib/rack/bundle/js_bundle.rb', line 4 def contents @contents end |
#hash ⇒ Object
Returns the value of attribute hash.
4 5 6 |
# File 'lib/rack/bundle/js_bundle.rb', line 4 def hash @hash end |
Instance Method Details
#==(bundle) ⇒ Object
14 15 16 |
# File 'lib/rack/bundle/js_bundle.rb', line 14 def == bundle self.class == bundle.class && hash == bundle.hash end |
#extension ⇒ Object
10 11 12 |
# File 'lib/rack/bundle/js_bundle.rb', line 10 def extension 'js' end |