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(description = nil, id = nil, is_active = nil, long_name = nil, name = nil, parent_category_id = nil, short_name = nil, subcategories = nil) ⇒ EntitiesCategoryResponse
constructor
A new instance of EntitiesCategoryResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(description = nil, id = nil, is_active = nil, long_name = nil, name = nil, parent_category_id = nil, short_name = 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(description = nil, id = nil, is_active = nil, long_name = nil, name = nil, parent_category_id = nil, short_name = nil, subcategories = nil) @description = description @id = id @is_active = is_active @long_name = long_name @name = name @parent_category_id = parent_category_id @short_name = short_name @subcategories = subcategories end |
Instance Attribute Details
#description ⇒ String
description of Category
7 8 9 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 7 def description @description end |
#id ⇒ Integer
id of Category
11 12 13 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 11 def id @id end |
#is_active ⇒ Boolean
status of Category
15 16 17 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 15 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
23 24 25 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 23 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
31 32 33 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 31 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 95 96 |
# File 'lib/gonebusy/models/entities_category_response.rb', line 72 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash description = hash["description"] id = hash["id"] is_active = hash["is_active"] long_name = hash["long_name"] name = hash["name"] parent_category_id = hash["parent_category_id"] short_name = hash["short_name"] subcategories = hash["subcategories"] # Create object from extracted values EntitiesCategoryResponse.new(description, id, is_active, long_name, name, parent_category_id, short_name, subcategories) end 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["description"] = "description" @hash["id"] = "id" @hash["is_active"] = "is_active" @hash["long_name"] = "long_name" @hash["name"] = "name" @hash["parent_category_id"] = "parent_category_id" @hash["short_name"] = "short_name" @hash["subcategories"] = "subcategories" end @hash end |