Class: CSSSprites::SpriteStylesheet
- Inherits:
-
Object
- Object
- CSSSprites::SpriteStylesheet
- Defined in:
- lib/css_sprites/sprite_stylesheet.rb
Constant Summary collapse
- INDENT =
' '- INVALID_CSS_NAME_CHARS =
/\W/
Instance Method Summary collapse
-
#initialize(image_grid) ⇒ SpriteStylesheet
constructor
A new instance of SpriteStylesheet.
- #to_s ⇒ Object
Constructor Details
#initialize(image_grid) ⇒ SpriteStylesheet
Returns a new instance of SpriteStylesheet.
5 6 7 |
# File 'lib/css_sprites/sprite_stylesheet.rb', line 5 def initialize(image_grid) @image_grid = image_grid end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/css_sprites/sprite_stylesheet.rb', line 9 def to_s style = '' rule_blocks.each do |block| style << "\n" unless rule_blocks[0] == block style << "#{ block[:selector] } {\n" style << "#{ declarations_to_s(block[:declarations]) }" style << "}\n" end style end |