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

#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, #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)


24
25
26
# File 'lib/party_foul/issue_renderers/rails.rb', line 24

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)


7
8
9
10
# File 'lib/party_foul/issue_renderers/rails.rb', line 7

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)


15
16
17
18
# File 'lib/party_foul/issue_renderers/rails.rb', line 15

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