Class: Compass::SassExtensions::Sprites::Layout::SpriteLayout
- Inherits:
-
Object
- Object
- Compass::SassExtensions::Sprites::Layout::SpriteLayout
- Defined in:
- lib/compass/sass_extensions/sprites/layout.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(images, kwargs = {}) ⇒ SpriteLayout
constructor
A new instance of SpriteLayout.
- #layout! ⇒ Object
- #properties ⇒ Object
Constructor Details
#initialize(images, kwargs = {}) ⇒ SpriteLayout
Returns a new instance of SpriteLayout.
11 12 13 14 15 16 17 18 |
# File 'lib/compass/sass_extensions/sprites/layout.rb', line 11 def initialize(images, kwargs={}) @images = images @options = kwargs @height = 0 @width = 0 layout! end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
9 10 11 |
# File 'lib/compass/sass_extensions/sprites/layout.rb', line 9 def height @height end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
8 9 10 |
# File 'lib/compass/sass_extensions/sprites/layout.rb', line 8 def images @images end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/compass/sass_extensions/sprites/layout.rb', line 8 def @options end |
#width ⇒ Object
Returns the value of attribute width.
9 10 11 |
# File 'lib/compass/sass_extensions/sprites/layout.rb', line 9 def width @width end |
Instance Method Details
#layout! ⇒ Object
20 21 22 |
# File 'lib/compass/sass_extensions/sprites/layout.rb', line 20 def layout! raise Compass::SpriteException, "You must impliment layout!" end |
#properties ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/compass/sass_extensions/sprites/layout.rb', line 24 def properties if @width.zero? raise Compass::SpriteException, "You must set the width fetching the properties" end if @height.zero? raise Compass::SpriteException, "You must set the height fetching the properties" end [@images, @width, @height] end |