Class: AirbrakeAPI::Error

Inherits:
Base
  • Object
show all
Defined in:
lib/airbrake-api/error.rb

Class Method Summary collapse

Methods inherited from Base

deprecate, fetch, setup

Class Method Details

.collection_pathObject

Deprecated.

Please use Client::errors_path instead


32
33
34
35
# File 'lib/airbrake-api/error.rb', line 32

def self.collection_path
  deprecate('Error.collection_path has been deprecated; use AibrakeAPI::Client#errors_path instead')
  AirbrakeAPI::Client.new.errors_path
end

.error_path(error_id) ⇒ Object

Deprecated.

Please use Client::error_path instead


38
39
40
41
# File 'lib/airbrake-api/error.rb', line 38

def self.error_path(error_id)
  deprecate('Error.error_path has been deprecated; use AibrakeAPI::Client#error_path instead')
  AirbrakeAPI::Client.new.error_path(error_id)
end

.find(*args) ⇒ Object

Deprecated.

Please use Client::error and Client::errors instead


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/airbrake-api/error.rb', line 7

def self.find(*args)
  deprecate('Error.find has been deprecated; use AibrakeAPI::Client#error and AibrakeAPI::Client#errors instead')

  results = case args.first
    when Fixnum
      id = args.shift
      options = args.last.is_a?(::Hash) ? args.pop : {}
      AirbrakeAPI::Client.new.error(id, options)
    when :all
      options = args.last.is_a?(::Hash) ? args.pop : {}
      AirbrakeAPI::Client.new.errors(options)
    else
      raise AirbrakeError.new('Invalid argument')
  end

  results
end

.update(error, options) ⇒ Object

Deprecated.

Please use Client::update instead


26
27
28
29
# File 'lib/airbrake-api/error.rb', line 26

def self.update(error, options)
  deprecate('Error.update has been deprecated; use AibrakeAPI::Client#update instead')
  AirbrakeAPI::Client.new.update(error, options)
end