Class: Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/cache.rb

Instance Method Summary collapse

Constructor Details

#initialize(artist) ⇒ Cache



2
3
4
# File 'lib/cache.rb', line 2

def initialize(artist)
  @artist = artist
end

Instance Method Details

#refreshObject



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

#restoreObject



12
13
14
15
# File 'lib/cache.rb', line 12

def restore
  @artist.image(@cached_image, 0, 0)
  self
end