Class: KStor::ErrorRegistry Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initializeErrorRegistry

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ErrorRegistry.



57
58
59
60
# File 'lib/kstor/error.rb', line 57

def initialize
  @error_classes = []
  @index = nil
end

Instance Method Details

#<<(klass) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



66
67
68
69
# File 'lib/kstor/error.rb', line 66

def <<(klass)
  @error_classes << klass
  @index = nil
end

#[](code) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



75
76
77
# File 'lib/kstor/error.rb', line 75

def [](code)
  index[code]
end

#classesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



62
63
64
# File 'lib/kstor/error.rb', line 62

def classes
  @error_classes.values
end

#key?(code) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


71
72
73
# File 'lib/kstor/error.rb', line 71

def key?(code)
  index.key?(code)
end