Exception: Arf::Status::BadStatus

Inherits:
Error
  • Object
show all
Defined in:
lib/arf/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, msg = nil) ⇒ BadStatus

Returns a new instance of BadStatus.



68
69
70
71
72
# File 'lib/arf/status.rb', line 68

def initialize(code, msg = nil)
  @code = code.is_a?(Symbol) ? code : TO_SYMBOL[code]
  @msg = msg || STATUS_TEXT[@code] || "Unknown status"
  super(@msg)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



66
67
68
# File 'lib/arf/status.rb', line 66

def code
  @code
end