Class: PartyFoul::IssueRenderers::Rails

Inherits:
Rack
  • Object
show all
Defined in:
lib/party_foul/issue_renderers/rails.rb

Instance Attribute Summary

Attributes inherited from Base

#body, #env, #exception, #sha

Instance Method Summary collapse

Methods inherited from Rack

#comment_options, #http_headers, #ip_address_locator, #request, #url

Methods inherited from Base

#body_options, #build_table_from_hash, #comment, #comment_options, #fingerprint, #initialize, #labels, #rows_for_table_from_hash, #stack_trace, #title, #update_body

Constructor Details

This class inherits a constructor from PartyFoul::IssueRenderers::Base

Instance Method Details

#occurred_atString

The timestamp when the exception occurred. Will use Time.current when available to record the time with the proper timezone

Returns:

  • (String)


22
23
24
# File 'lib/party_foul/issue_renderers/rails.rb', line 22

def occurred_at
  @occurred_at ||= Time.current.strftime('%B %d, %Y %H:%M:%S %z')
end

#paramsHash

Rails params hash. Filtered parms are respected.

Returns:

  • (Hash)


5
6
7
8
# File 'lib/party_foul/issue_renderers/rails.rb', line 5

def params
  parameter_filter = ActionDispatch::Http::ParameterFilter.new(env["action_dispatch.parameter_filter"])
  parameter_filter.filter(env['action_dispatch.request.parameters'])
end

#sessionHash

Rails session hash. Filtered parms are respected.

Returns:

  • (Hash)


13
14
15
16
# File 'lib/party_foul/issue_renderers/rails.rb', line 13

def session
  parameter_filter = ActionDispatch::Http::ParameterFilter.new(env['action_dispatch.parameter_filter'])
  parameter_filter.filter(env['rack.session'] || { } )
end