lib/honeybadger/rack/user_feedback.rb in honeybadger-4.3.1 vs lib/honeybadger/rack/user_feedback.rb in honeybadger-4.4.0
- old
+ new
@@ -21,11 +21,11 @@
class UserFeedback
extend Forwardable
def initialize(app, agent = nil)
@app = app
- @agent = agent.kind_of?(Agent) ? agent : Honeybadger::Agent.instance
+ @agent = agent.kind_of?(Agent) && agent
end
def call(env)
return @app.call(env) unless config[:'feedback.enabled']
status, headers, body = @app.call(env)
@@ -74,11 +74,15 @@
end
end
private
- attr_reader :agent
def_delegator :agent, :config
def_delegator :config, :logger
+
+ def agent
+ @agent || Honeybadger::Agent.instance
+ end
+
end
end
end