Class: BBCNet::CacheMetaInfoDevice

Inherits:
CasheDevice::CacheDeviceBase show all
Defined in:
lib/bbcnet.rb

Instance Attribute Summary

Attributes inherited from CasheDevice::CacheDeviceBase

#cacheDuration, #cacheMax

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CasheDevice::CacheDeviceBase

#read, #restoreCache

Constructor Details

#initialize(cacheDuration = 40*60, cacheMax = 200) ⇒ CacheMetaInfoDevice

Returns a new instance of CacheMetaInfoDevice.



27
28
29
# File 'lib/bbcnet.rb', line 27

def initialize(cacheDuration = 40*60, cacheMax=200)
    super(cacheDuration, cacheMax)
end

Class Method Details

.read(url) ⇒ Object



38
39
40
41
# File 'lib/bbcnet.rb', line 38

def self.read(url)
    pid = BBCNet.extractPid(url)
    self.instance.read(pid)
end

Instance Method Details

#directRead(pid) ⇒ Object

return : [ data, key ]

key : key to restore data.


33
34
35
36
# File 'lib/bbcnet.rb', line 33

def directRead(pid)
    data = BBCNet::MetaInfo.new(pid).update
    [ data, data ]
end