Class: Cache
- Inherits:
-
Object
- Object
- Cache
- Defined in:
- lib/cache.rb
Instance Method Summary collapse
-
#initialize(artist) ⇒ Cache
constructor
A new instance of Cache.
- #refresh ⇒ Object
- #restore ⇒ Object
Constructor Details
#initialize(artist) ⇒ Cache
Returns a new instance of Cache.
2 3 4 |
# File 'lib/cache.rb', line 2 def initialize(artist) @artist = artist end |
Instance Method Details
#refresh ⇒ Object
6 7 8 9 10 |
# File 'lib/cache.rb', line 6 def refresh @artist.save("buffer.jpg") @cached_image = @artist.loadImage("buffer.jpg") self end |
#restore ⇒ Object
12 13 14 15 |
# File 'lib/cache.rb', line 12 def restore @artist.image(@cached_image, 0, 0) self end |