Exception: Rmega::Errors::ServerError
- Inherits:
-
StandardError
- Object
- StandardError
- Rmega::Errors::ServerError
- Defined in:
- lib/rmega/errors.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#temporary ⇒ Object
Returns the value of attribute temporary.
Instance Method Summary collapse
-
#initialize(value, opts = {}) ⇒ ServerError
constructor
A new instance of ServerError.
- #temporary? ⇒ Boolean
Constructor Details
#initialize(value, opts = {}) ⇒ ServerError
Returns a new instance of ServerError.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rmega/errors.rb', line 34 def initialize(value, opts = {}) if msg = Errors::CODES[value.to_i] @code = value.to_i = msg || "Error code #{@code}" else = value end self.temporary = opts[:temporary] || false super() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
31 32 33 |
# File 'lib/rmega/errors.rb', line 31 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
31 32 33 |
# File 'lib/rmega/errors.rb', line 31 def end |
#temporary ⇒ Object
Returns the value of attribute temporary.
32 33 34 |
# File 'lib/rmega/errors.rb', line 32 def temporary @temporary end |
Instance Method Details
#temporary? ⇒ Boolean
47 48 49 |
# File 'lib/rmega/errors.rb', line 47 def temporary? self.temporary || [-3, -18, -6].include?(@code) end |