Class: PartyFoul::IssueRenderers::Rack
- Defined in:
- lib/party_foul/issue_renderers/rack.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #comment_options ⇒ Object
-
#http_headers ⇒ Hash
HTTP Headers hash from the request.
-
#ip_address_locator ⇒ String
Link to IP address geolocator of the client who triggered the exception.
-
#params ⇒ Hash
Rack params.
- #request ⇒ Object
-
#session ⇒ Hash
The session hash for the client at the time of the exception.
- #url ⇒ Object
Methods inherited from Base
#body, #body_options, #build_table_from_hash, #comment, #fingerprint, #initialize, #labels, #occurred_at, #rows_for_table_from_hash, #stack_trace, #title, #update_body
Constructor Details
This class inherits a constructor from PartyFoul::IssueRenderers::Base
Instance Method Details
#comment_options ⇒ Object
9 10 11 |
# File 'lib/party_foul/issue_renderers/rack.rb', line 9 def super.merge(URL: url, Params: params, Session: session, 'IP Address' => ip_address_locator, 'HTTP Headers' => http_headers) end |
#http_headers ⇒ Hash
HTTP Headers hash from the request. Headers can be filtered out by adding matching key names to PartyFoul.blacklisted_headers
42 43 44 45 46 47 48 49 |
# File 'lib/party_foul/issue_renderers/rack.rb', line 42 def http_headers { Version: env['HTTP_VERSION'], 'User Agent' => request.user_agent, 'Accept Encoding' => env['HTTP_ACCEPT_ENCODING'], Accept: env['HTTP_ACCEPT'], } end |
#ip_address_locator ⇒ String
Link to IP address geolocator of the client who triggered the exception
23 24 25 |
# File 'lib/party_foul/issue_renderers/rack.rb', line 23 def ip_address_locator "<a href='http://ipinfo.io/#{request.ip}'>#{request.ip}</a>" end |
#params ⇒ Hash
Rack params
16 17 18 |
# File 'lib/party_foul/issue_renderers/rack.rb', line 16 def params request.params end |
#request ⇒ Object
5 6 7 |
# File 'lib/party_foul/issue_renderers/rack.rb', line 5 def request @request ||= ::Rack::Request.new(env) end |
#session ⇒ Hash
The session hash for the client at the time of the exception
34 35 36 |
# File 'lib/party_foul/issue_renderers/rack.rb', line 34 def session request.session end |
#url ⇒ Object
27 28 29 |
# File 'lib/party_foul/issue_renderers/rack.rb', line 27 def url "[#{request.request_method}] #{env['REQUEST_URI']}" end |