Class: Tenon::AssetStyleGenerator
- Inherits:
-
Object
- Object
- Tenon::AssetStyleGenerator
- Defined in:
- lib/tenon/asset_style_generator.rb
Instance Attribute Summary collapse
-
#asset ⇒ Object
readonly
Returns the value of attribute asset.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(asset) ⇒ AssetStyleGenerator
constructor
A new instance of AssetStyleGenerator.
- #styles ⇒ Object
Constructor Details
#initialize(asset) ⇒ AssetStyleGenerator
Returns a new instance of AssetStyleGenerator.
9 10 11 |
# File 'lib/tenon/asset_style_generator.rb', line 9 def initialize(asset) @asset = asset end |
Instance Attribute Details
#asset ⇒ Object (readonly)
Returns the value of attribute asset.
3 4 5 |
# File 'lib/tenon/asset_style_generator.rb', line 3 def asset @asset end |
Class Method Details
.generate(asset) ⇒ Object
5 6 7 |
# File 'lib/tenon/asset_style_generator.rb', line 5 def self.generate(asset) new(asset).styles end |
Instance Method Details
#styles ⇒ Object
13 14 15 16 17 |
# File 'lib/tenon/asset_style_generator.rb', line 13 def styles @styles ||= Hash[*item_assets.map do |ia| get_styles_from_item(ia) || [] end.flatten].merge(default_styles) end |