Class: I18n::Airbrake::Handler
- Inherits:
-
Object
- Object
- I18n::Airbrake::Handler
- Defined in:
- lib/i18n-airbrake/handler.rb
Instance Method Summary collapse
- #call ⇒ Object
- #exception ⇒ Object
-
#initialize(exception, locale, key, options) ⇒ Handler
constructor
A new instance of Handler.
- #notify ⇒ Object
Constructor Details
#initialize(exception, locale, key, options) ⇒ Handler
Returns a new instance of Handler.
5 6 7 |
# File 'lib/i18n-airbrake/handler.rb', line 5 def initialize(exception, locale, key, ) @exception, @locale, @key, @options = exception, locale, key, end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/i18n-airbrake/handler.rb', line 9 def call if Rails.env.development? or Rails.env.test? fail exception else notify @key.to_s.titleize end end |
#exception ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/i18n-airbrake/handler.rb', line 18 def exception if @exception.respond_to?(:to_exception) @exception.to_exception else @exception end end |
#notify ⇒ Object
26 27 28 |
# File 'lib/i18n-airbrake/handler.rb', line 26 def notify ::Airbrake.notify exception end |