Class: Arthur::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/arthur/error.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Error

Returns a new instance of Error.



11
12
13
# File 'lib/arthur/error.rb', line 11

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



9
10
11
# File 'lib/arthur/error.rb', line 9

def data
  @data
end

Class Method Details

.fetch(error_id) ⇒ Object



5
6
7
# File 'lib/arthur/error.rb', line 5

def self.fetch(error_id)
  Arthur::Error.new(Arthur::Api.get("/errors/#{error_id}"))
end

Instance Method Details

#count_in_environment(env) ⇒ Object



15
16
17
# File 'lib/arthur/error.rb', line 15

def count_in_environment(env)
  @data['release_stages'].fetch(env, 0)
end