Class: Rack::Bundle::CSSBundle

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/bundle/css_bundle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*files) ⇒ CSSBundle

Returns a new instance of CSSBundle.



5
6
7
8
# File 'lib/rack/bundle/css_bundle.rb', line 5

def initialize *files
  @contents = files.join "\n"
  @hash = MD5.new(@contents).to_s
end

Instance Attribute Details

#contentsObject

Returns the value of attribute contents.



4
5
6
# File 'lib/rack/bundle/css_bundle.rb', line 4

def contents
  @contents
end

#hashObject

Returns the value of attribute hash.



4
5
6
# File 'lib/rack/bundle/css_bundle.rb', line 4

def hash
  @hash
end

Instance Method Details

#==(bundle) ⇒ Object



14
15
16
# File 'lib/rack/bundle/css_bundle.rb', line 14

def == bundle
  self.class == bundle.class && hash == bundle.hash
end

#extensionObject



10
11
12
# File 'lib/rack/bundle/css_bundle.rb', line 10

def extension
  'css'
end