Class: ExceptionNotifier::IdobataNotifier
- Inherits:
-
Object
- Object
- ExceptionNotifier::IdobataNotifier
- Defined in:
- lib/exception_notifier/idobata_notifier.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #call(exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ IdobataNotifier
constructor
A new instance of IdobataNotifier.
Constructor Details
#initialize(options) ⇒ IdobataNotifier
Returns a new instance of IdobataNotifier.
9 10 11 12 13 |
# File 'lib/exception_notifier/idobata_notifier.rb', line 9 def initialize() = (, :url, :skip_library_backtrace, :proxy) raise(ArgumentError, 'Endpoint must be specified') unless @url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/exception_notifier/idobata_notifier.rb', line 7 def url @url end |
Instance Method Details
#call(exception, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/exception_notifier/idobata_notifier.rb', line 15 def call(exception, ={}) enviroments = if [:env] request_option(ActionDispatch::Request.new([:env])) else # [TODO] - Add option specification route for non-web notification {'Timestamp' => Time.zone.now} end source = (exception, enviroments) http_client.post_form URI.parse(url), source: source, format: :html end |