Class: PuppetLibrary::Http::Cache::Disk

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

Instance Method Summary collapse

Constructor Details

#initialize(directory) ⇒ Disk

Returns a new instance of Disk.



20
21
22
# File 'lib/puppet_library/http/cache/disk.rb', line 20

def initialize(directory)
    @directory = directory
end

Instance Method Details

#get(path) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/puppet_library/http/cache/disk.rb', line 24

def get(path)
    unless include? path
        buffer = yield
        save(path, buffer)
    end
    retrieve(path)
end