Class: Raas::RaasServerErrorModel
- Defined in:
- lib/raas/models/raas_server_error_model.rb
Overview
Represents a RaaS 5xx Error
Instance Attribute Summary collapse
-
#code ⇒ Integer
The RaaS error code.
-
#message ⇒ String
The error message.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(message = nil, code = nil) ⇒ RaasServerErrorModel
constructor
A new instance of RaasServerErrorModel.
Methods inherited from BaseModel
Constructor Details
#initialize(message = nil, code = nil) ⇒ RaasServerErrorModel
Returns a new instance of RaasServerErrorModel.
23 24 25 26 27 |
# File 'lib/raas/models/raas_server_error_model.rb', line 23 def initialize( = nil, code = nil) @message = @code = code end |
Instance Attribute Details
#code ⇒ Integer
The RaaS error code
13 14 15 |
# File 'lib/raas/models/raas_server_error_model.rb', line 13 def code @code end |
#message ⇒ String
The error message
9 10 11 |
# File 'lib/raas/models/raas_server_error_model.rb', line 9 def @message end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/raas/models/raas_server_error_model.rb', line 30 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash['message'] code = hash['code'] # Create object from extracted values. RaasServerErrorModel.new(, code) end |
.names ⇒ Object
A mapping from model property names to API property names.
16 17 18 19 20 21 |
# File 'lib/raas/models/raas_server_error_model.rb', line 16 def self.names @_hash = {} if @_hash.nil? @_hash['message'] = 'message' @_hash['code'] = 'code' @_hash end |