Class: ShipEngine::Exceptions::ErrorCode

Inherits:
Object
  • Object
show all
Defined in:
lib/shipengine/exceptions/error_code.rb

Overview

This class has the ability to return a specific error code.

#/

Class Method Summary collapse

Class Method Details

.get(key) ⇒ Symbol

Returns error code.

Parameters:

  • key (Symbol)

Returns:

  • (Symbol)

    error code



13
14
15
# File 'lib/shipengine/exceptions/error_code.rb', line 13

def self.get(key)
  @codes[key]
end

.get_by_str(str_key) ⇒ Symbol

Returns error code.

Parameters:

  • str_key (String)

Returns:

  • (Symbol)

    error code



19
20
21
# File 'lib/shipengine/exceptions/error_code.rb', line 19

def self.get_by_str(str_key)
  get(str_key.upcase.to_sym)
end