Class: Gonebusy::EntitiesThingTypeResponse
- Defined in:
- lib/gonebusy/models/entities_thing_type_response.rb
Instance Attribute Summary collapse
-
#id ⇒ Integer
id of Category.
-
#name ⇒ String
name of Category.
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(id = nil, name = nil) ⇒ EntitiesThingTypeResponse
constructor
A new instance of EntitiesThingTypeResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, name = nil) ⇒ EntitiesThingTypeResponse
Returns a new instance of EntitiesThingTypeResponse.
23 24 25 26 27 |
# File 'lib/gonebusy/models/entities_thing_type_response.rb', line 23 def initialize(id = nil, name = nil) @id = id @name = name end |
Instance Attribute Details
#id ⇒ Integer
id of Category
7 8 9 |
# File 'lib/gonebusy/models/entities_thing_type_response.rb', line 7 def id @id end |
#name ⇒ String
name of Category
11 12 13 |
# File 'lib/gonebusy/models/entities_thing_type_response.rb', line 11 def name @name 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 41 42 |
# File 'lib/gonebusy/models/entities_thing_type_response.rb', line 30 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash id = hash["id"] name = hash["name"] # Create object from extracted values EntitiesThingTypeResponse.new(id, name) end end |
.names ⇒ Object
A mapping from model property names to API property names
14 15 16 17 18 19 20 21 |
# File 'lib/gonebusy/models/entities_thing_type_response.rb', line 14 def self.names if @hash.nil? @hash = {} @hash["id"] = "id" @hash["name"] = "name" end @hash end |