lib/hanami/views/default.rb in hanami-1.0.0.beta2 vs lib/hanami/views/default.rb in hanami-1.0.0.beta3
- old
+ new
@@ -1,8 +1,9 @@
require 'hanami/views/default_template_finder'
module Hanami
+ # @api private
module Views
# The default view that is rendered for non successful responses (200 and 201)
#
# @since 0.1.0
# @api private
@@ -13,13 +14,15 @@
layout nil
root Pathname.new(File.dirname(__FILE__)).join('../templates').realpath
template 'default'
+ # @api private
def title
"#{response[0]} - #{response[2].first || Http::Status.message_for(response[0])}"
end
+ # @api private
def self.render(root, template_name, context)
format = context[:format]
template = DefaultTemplateFinder.new(self, root, template_name, format).find
if template