Class: CSSSprites::Sprite
- Inherits:
-
Object
- Object
- CSSSprites::Sprite
- Defined in:
- lib/css_sprites/sprite.rb
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(path, options = {}) ⇒ Sprite
constructor
A new instance of Sprite.
- #name ⇒ Object
- #stylesheet ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ Sprite
Returns a new instance of Sprite.
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/css_sprites/sprite.rb', line 2 def initialize(path, = {}) validate_path(path) [:name] ||= File.basename(path) @name = [:name] @images = load_images(path) @image_grid = CSSSprites::ImageGrid.new(@images, ) @stylesheet = CSSSprites::SpriteStylesheet.new(@image_grid) end |
Instance Method Details
#image ⇒ Object
18 19 20 |
# File 'lib/css_sprites/sprite.rb', line 18 def image @image_grid.to_image end |
#name ⇒ Object
14 15 16 |
# File 'lib/css_sprites/sprite.rb', line 14 def name @name end |
#stylesheet ⇒ Object
22 23 24 |
# File 'lib/css_sprites/sprite.rb', line 22 def stylesheet @stylesheet.to_s end |