Class: Shutterbug::Handlers::FileHandlers::HtmlFile

Inherits:
Base
  • Object
show all
Defined in:
lib/shutterbug/handlers/file_handlers/html_file.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#filename, #filename_matcher, #initialize, instance, #path_prefix, #regex, #urlify

Constructor Details

This class inherits a constructor from Shutterbug::Handlers::FileHandlers::Base

Instance Method Details

#file_extensionObject



6
7
8
# File 'lib/shutterbug/handlers/file_handlers/html_file.rb', line 6

def file_extension
  "html"
end

#handle(helper, req, env) ⇒ Object



14
15
16
17
18
# File 'lib/shutterbug/handlers/file_handlers/html_file.rb', line 14

def handle(helper, req, env)
  sha  = regex.match(req.path)[1]
  file = @config.storage.new(filename(sha),self)
  helper.good_response(file.get_content, self.mime_type)
end

#mime_typeObject



10
11
12
# File 'lib/shutterbug/handlers/file_handlers/html_file.rb', line 10

def mime_type
  "text/html"
end