lib/airbrake.rb in airbrake-3.0.2 vs lib/airbrake.rb in airbrake-3.0.3
- old
+ new
@@ -33,11 +33,11 @@
# Must respond to #send_to_airbrake. See Airbrake::Sender.
attr_accessor :sender
# A Airbrake configuration object. Must act like a hash and return sensible
# values for all Airbrake configuration options. See Airbrake::Configuration.
- attr_accessor :configuration
+ attr_writer :configuration
# Tell the log that the Notifier is good to go
def report_ready
write_verbose_log("Notifier #{VERSION} ready to catch errors")
end
@@ -75,13 +75,18 @@
# Airbrake.configure do |config|
# config.api_key = '1234567890abcdef'
# config.secure = false
# end
def configure(silent = false)
- self.configuration ||= Configuration.new
yield(configuration)
self.sender = Sender.new(configuration)
report_ready unless silent
+ end
+
+ # The configuration object.
+ # @see Airbrake.configure
+ def configuration
+ @configuration ||= Configuration.new
end
# Sends an exception manually using this method, even when you are not in a controller.
#
# @param [Exception] exception The exception you want to notify Airbrake about.