Class: TestAsdasdasd::ApiResponse
- Defined in:
- lib/test_asdasdasd/models/api_response.rb
Overview
ApiResponse Model.
Instance Attribute Summary collapse
-
#code ⇒ Integer
TODO: Write general description for this method.
-
#message ⇒ String
TODO: Write general description for this method.
-
#type ⇒ String
TODO: Write general description for this method.
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(code = nil, type = nil, message = nil) ⇒ ApiResponse
constructor
A new instance of ApiResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(code = nil, type = nil, message = nil) ⇒ ApiResponse
Returns a new instance of ApiResponse.
30 31 32 33 34 35 36 |
# File 'lib/test_asdasdasd/models/api_response.rb', line 30 def initialize(code = nil, type = nil, = nil) @code = code @type = type = end |
Instance Attribute Details
#code ⇒ Integer
TODO: Write general description for this method
11 12 13 |
# File 'lib/test_asdasdasd/models/api_response.rb', line 11 def code @code end |
#message ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/test_asdasdasd/models/api_response.rb', line 19 def end |
#type ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/test_asdasdasd/models/api_response.rb', line 15 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/test_asdasdasd/models/api_response.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash['code'] type = hash['type'] = hash['message'] # Create object from extracted values. ApiResponse.new(code, type, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 28 |
# File 'lib/test_asdasdasd/models/api_response.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['type'] = 'type' @_hash['message'] = 'message' @_hash end |