Class: BistroCar::Bundle
- Inherits:
-
Object
- Object
- BistroCar::Bundle
- Defined in:
- lib/bistro_car/bundle.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #file_paths ⇒ Object
-
#initialize(name) ⇒ Bundle
constructor
A new instance of Bundle.
- #javascript_url ⇒ Object
- #to_javascript ⇒ Object
Constructor Details
permalink #initialize(name) ⇒ Bundle
Returns a new instance of Bundle.
5 6 7 |
# File 'lib/bistro_car/bundle.rb', line 5 def initialize(name) @name = name.to_sym end |
Instance Attribute Details
permalink #name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/bistro_car/bundle.rb', line 3 def name @name end |
Instance Method Details
permalink #file_paths ⇒ Object
[View source]
9 10 11 |
# File 'lib/bistro_car/bundle.rb', line 9 def file_paths Dir.glob(path.join('*.coffee')).to_a end |
permalink #javascript_url ⇒ Object
[View source]
17 18 19 |
# File 'lib/bistro_car/bundle.rb', line 17 def javascript_url "/javascripts/bundle/#{name}.js" end |
permalink #to_javascript ⇒ Object
[View source]
13 14 15 |
# File 'lib/bistro_car/bundle.rb', line 13 def to_javascript minify(file_paths.map { |path| BistroCar.compile(File.read(path.to_s)) }.join) end |