class ContentCaching::Adapter::FsAdapter

Public Class Methods

new(wrapper, options) click to toggle source
Calls superclass method ContentCaching::Adapter::Abstract::new
# File lib/content_caching/adapters/fs_adapter.rb, line 10
def initialize(wrapper, options)
  super
end

Public Instance Methods

delete() click to toggle source
# File lib/content_caching/adapters/fs_adapter.rb, line 22
def delete
  adapter.delete document_path
end
store(content) click to toggle source
# File lib/content_caching/adapters/fs_adapter.rb, line 18
def store content
  adapter.store document_path, content
end
url() click to toggle source
# File lib/content_caching/adapters/fs_adapter.rb, line 14
def url
  adapter.url document_url
end

Private Instance Methods

adapter() click to toggle source
# File lib/content_caching/adapters/fs_adapter.rb, line 37
def adapter
  @adapter ||= Fs::new
end
document_path() click to toggle source
# File lib/content_caching/adapters/fs_adapter.rb, line 32
def document_path
  return @wrapper.to_path unless @options[:directory]
  Pathname([@options[:directory], @wrapper.to_path].join('/')).cleanpath.to_path
end
document_url() click to toggle source
# File lib/content_caching/adapters/fs_adapter.rb, line 28
def document_url
  @options[:host] + '/' + Pathname(@wrapper.to_path).cleanpath.to_path
end