Class: ImageMosaic::Image::Mosaic
- Inherits:
-
Object
- Object
- ImageMosaic::Image::Mosaic
- Defined in:
- lib/image_mosaic/image/mosaic.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
Instance Method Summary collapse
- #filename ⇒ Object
-
#initialize(image) ⇒ Mosaic
constructor
A new instance of Mosaic.
- #save ⇒ Object
Constructor Details
#initialize(image) ⇒ Mosaic
Returns a new instance of Mosaic.
6 7 8 9 |
# File 'lib/image_mosaic/image/mosaic.rb', line 6 def initialize(image) @image = image @securerandom = SecureRandom.uuid end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
4 5 6 |
# File 'lib/image_mosaic/image/mosaic.rb', line 4 def image @image end |
Instance Method Details
#filename ⇒ Object
15 16 17 |
# File 'lib/image_mosaic/image/mosaic.rb', line 15 def filename "mosaic_#{@securerandom}.png" end |
#save ⇒ Object
11 12 13 |
# File 'lib/image_mosaic/image/mosaic.rb', line 11 def save @image.write(filename) end |