Class: Gonebusy::EntitiesCategoryResponse
- Defined in:
- lib/gonebusy/models/entities_category_response.rb
Instance Attribute Summary collapse
-
#description ⇒ String
description of Category.
-
#id ⇒ Integer
id of Category.
-
#is_active ⇒ Boolean
status of Category.
-
#long_name ⇒ String
extended name for Category.
-
#name ⇒ String
name of Category.
-
#parent_category_id ⇒ Integer
id of parent Category, if any.
-
#short_name ⇒ String
abbreviated name for Category.
-
#subcategories ⇒ List of Integer
array of subcategory ids, if any.
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, short_name = nil, long_name = nil, description = nil, parent_category_id = nil, is_active = nil, subcategories = nil) ⇒ EntitiesCategoryResponse
constructor
A new instance of EntitiesCategoryResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, name = nil, short_name = nil, long_name = nil, description = nil, parent_category_id = nil, is_active = nil, subcategories = nil) ⇒ EntitiesCategoryResponse
Returns a new instance of EntitiesCategoryResponse.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 53 def initialize(id = nil, name = nil, short_name = nil, long_name = nil, description = nil, parent_category_id = nil, is_active = nil, subcategories = nil) @id = id @name = name @short_name = short_name @long_name = long_name @description = description @parent_category_id = parent_category_id @is_active = is_active @subcategories = subcategories end |
Instance Attribute Details
#description ⇒ String
description of Category
23 24 25 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 23 def description @description end |
#id ⇒ Integer
id of Category
7 8 9 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 7 def id @id end |
#is_active ⇒ Boolean
status of Category
31 32 33 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 31 def is_active @is_active end |
#long_name ⇒ String
extended name for Category
19 20 21 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 19 def long_name @long_name end |
#name ⇒ String
name of Category
11 12 13 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 11 def name @name end |
#parent_category_id ⇒ Integer
id of parent Category, if any
27 28 29 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 27 def parent_category_id @parent_category_id end |
#short_name ⇒ String
abbreviated name for Category
15 16 17 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 15 def short_name @short_name end |
#subcategories ⇒ List of Integer
array of subcategory ids, if any
35 36 37 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 35 def subcategories @subcategories end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash id = hash['id'] name = hash['name'] short_name = hash['short_name'] long_name = hash['long_name'] description = hash['description'] parent_category_id = hash['parent_category_id'] is_active = hash['is_active'] subcategories = hash['subcategories'] # Create object from extracted values EntitiesCategoryResponse.new(id, name, short_name, long_name, description, parent_category_id, is_active, subcategories) end |
.names ⇒ Object
A mapping from model property names to API property names
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 38 def self.names if @_hash.nil? @_hash = {} @_hash["id"] = "id" @_hash["name"] = "name" @_hash["short_name"] = "short_name" @_hash["long_name"] = "long_name" @_hash["description"] = "description" @_hash["parent_category_id"] = "parent_category_id" @_hash["is_active"] = "is_active" @_hash["subcategories"] = "subcategories" end @_hash end |