Class: WGif::VideoCache

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

Instance Method Summary collapse

Constructor Details

#initializeVideoCache

Returns a new instance of VideoCache.



6
7
8
# File 'lib/wgif/video_cache.rb', line 6

def initialize
  @cache = {}
end

Instance Method Details

#get(video_id) ⇒ Object



10
11
12
13
# File 'lib/wgif/video_cache.rb', line 10

def get(video_id)
  path = "/tmp/wgif/#{video_id}"
  WGif::Video.new(video_id, path) if Pathname.new(path).exist?
end