Class: GlobalErrorHandler::Parser
- Inherits:
-
Object
- Object
- GlobalErrorHandler::Parser
- Defined in:
- lib/global_error_handler/parser.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#info_hash ⇒ Object
readonly
Returns the value of attribute info_hash.
Instance Method Summary collapse
-
#initialize(env, exception, controller) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(env, exception, controller) ⇒ Parser
Returns a new instance of Parser.
5 6 7 8 9 10 11 |
# File 'lib/global_error_handler/parser.rb', line 5 def initialize(env, exception, controller) @env = env @exception = exception @controller = controller @request = ActionDispatch::Request.new(@env) @info_hash = Hashie::Mash.new end |
Instance Attribute Details
#info_hash ⇒ Object (readonly)
Returns the value of attribute info_hash.
3 4 5 |
# File 'lib/global_error_handler/parser.rb', line 3 def info_hash @info_hash end |
Instance Method Details
#parse ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/global_error_handler/parser.rb', line 13 def parse info_hash.error_class = @exception.class.to_s.strip info_hash. = @exception..to_s.strip info_hash.error_trace = form_backtrace @exception.backtrace info_hash.request_method = @request.method info_hash.request_params = @request.params.to_s info_hash.target_url = @request.url info_hash.referer_url = @request.referer info_hash.user_agent = @request.user_agent info_hash.user_info = user_info.to_s info_hash. = Time.current.utc self end |