Class: Gandi::FaultCode
- Inherits:
-
Object
- Object
- Gandi::FaultCode
- Defined in:
- lib/gandi/fault_code.rb,
lib/gandi/fault_code/data.rb,
lib/gandi/fault_code/server.rb,
lib/gandi/fault_code/unknown.rb
Defined Under Namespace
Classes: Data, Server, Unknown
Constant Summary collapse
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
- #exception ⇒ Object
-
#initialize(object, cause, msg = nil) ⇒ FaultCode
constructor
A new instance of FaultCode.
Constructor Details
#initialize(object, cause, msg = nil) ⇒ FaultCode
Returns a new instance of FaultCode.
20 21 22 23 24 |
# File 'lib/gandi/fault_code.rb', line 20 def initialize(object, cause, msg = nil) @object = self.class::OBJECT[object] || :object_invalid @cause = self.class::CAUSE[cause] || :cause_invalid @msg = msg end |
Instance Attribute Details
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
18 19 20 |
# File 'lib/gandi/fault_code.rb', line 18 def cause @cause end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
18 19 20 |
# File 'lib/gandi/fault_code.rb', line 18 def msg @msg end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
18 19 20 |
# File 'lib/gandi/fault_code.rb', line 18 def object @object end |
Class Method Details
Instance Method Details
#exception ⇒ Object
26 27 28 |
# File 'lib/gandi/fault_code.rb', line 26 def exception self.class::ERROR.new(msg, self) end |