Class Heel::ErrorResponse
In: lib/heel/error_response.rb
lib/heel/error_response.rb
Parent: ::Rack::Response

Methods

finish   finish   homepage   homepage   new   new   template   template   template_file   template_file  

Attributes

base_uri  [R] 
base_uri  [R] 

Public Class methods

[Source]

    # File lib/heel/error_response.rb, line 25
25:       def homepage
26:         @homepage ||= Heel::Configuration::HOMEPAGE
27:       end

[Source]

    # File lib/heel/error_response.rb, line 25
25:       def homepage
26:         @homepage ||= Heel::Configuration::HOMEPAGE
27:       end

[Source]

    # File lib/heel/error_response.rb, line 30
30:     def initialize(base_uri, body, status = 404, header = {})
31:       super(body, status, header)
32:       self['Content-type'] = 'text/html'
33:       @base_uri = base_uri
34:     end

[Source]

    # File lib/heel/error_response.rb, line 30
30:     def initialize(base_uri, body, status = 404, header = {})
31:       super(body, status, header)
32:       self['Content-type'] = 'text/html'
33:       @base_uri = base_uri
34:     end

[Source]

    # File lib/heel/error_response.rb, line 21
21:       def template
22:         @template ||= ::ERB.new(File.read(template_file))
23:       end

[Source]

    # File lib/heel/error_response.rb, line 21
21:       def template
22:         @template ||= ::ERB.new(File.read(template_file))
23:       end

[Source]

    # File lib/heel/error_response.rb, line 17
17:       def template_file
18:         @template_file ||= Heel::Configuration.data_path("error.rhtml")
19:       end

[Source]

    # File lib/heel/error_response.rb, line 17
17:       def template_file
18:         @template_file ||= Heel::Configuration.data_path("error.rhtml")
19:       end

Public Instance methods

[Source]

    # File lib/heel/error_response.rb, line 36
36:     def finish
37:       message  = ::Rack::Utils::HTTP_STATUS_CODES[status]
38:       homepage = ErrorResponse.homepage
39: 
40:       return [ status, header.to_hash, ErrorResponse.template.result(binding) ]
41:     end

[Source]

    # File lib/heel/error_response.rb, line 36
36:     def finish
37:       message  = ::Rack::Utils::HTTP_STATUS_CODES[status]
38:       homepage = ErrorResponse.homepage
39: 
40:       return [ status, header.to_hash, ErrorResponse.template.result(binding) ]
41:     end

[Validate]