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.



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

def initialize(directory)
    @directory = directory
end

Instance Method Details

#get(path) ⇒ Object



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

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