Class: Gonebusy::CreateCategoryBody
- Defined in:
- lib/gonebusy/models/create_category_body.rb
Instance Attribute Summary collapse
-
#description ⇒ String
Category Description.
-
#long_name ⇒ String
Optional full name of Category.
-
#name ⇒ String
Category Name.
-
#parent_category_id ⇒ Integer
Optional Id of Parent Category.
-
#short_name ⇒ String
Optional abbreviated Category name.
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, name = nil, long_name = nil, parent_category_id = nil, short_name = nil) ⇒ CreateCategoryBody
constructor
A new instance of CreateCategoryBody.
Methods inherited from BaseModel
Constructor Details
#initialize(description = nil, name = nil, long_name = nil, parent_category_id = nil, short_name = nil) ⇒ CreateCategoryBody
Returns a new instance of CreateCategoryBody.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/gonebusy/models/create_category_body.rb', line 38 def initialize(description = nil, name = nil, long_name = nil, parent_category_id = nil, short_name = nil) @description = description @name = name @long_name = long_name @parent_category_id = parent_category_id @short_name = short_name end |
Instance Attribute Details
#description ⇒ String
Category Description
7 8 9 |
# File 'lib/gonebusy/models/create_category_body.rb', line 7 def description @description end |
#long_name ⇒ String
Optional full name of Category
15 16 17 |
# File 'lib/gonebusy/models/create_category_body.rb', line 15 def long_name @long_name end |
#name ⇒ String
Category Name
11 12 13 |
# File 'lib/gonebusy/models/create_category_body.rb', line 11 def name @name end |
#parent_category_id ⇒ Integer
Optional Id of Parent Category
19 20 21 |
# File 'lib/gonebusy/models/create_category_body.rb', line 19 def parent_category_id @parent_category_id end |
#short_name ⇒ String
Optional abbreviated Category name
23 24 25 |
# File 'lib/gonebusy/models/create_category_body.rb', line 23 def short_name @short_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/gonebusy/models/create_category_body.rb', line 51 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash description = hash["description"] name = hash["name"] long_name = hash["long_name"] parent_category_id = hash["parent_category_id"] short_name = hash["short_name"] # Create object from extracted values CreateCategoryBody.new(description, name, long_name, parent_category_id, short_name) end end |
.names ⇒ Object
A mapping from model property names to API property names
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gonebusy/models/create_category_body.rb', line 26 def self.names if @hash.nil? @hash = {} @hash["description"] = "description" @hash["name"] = "name" @hash["long_name"] = "long_name" @hash["parent_category_id"] = "parent_category_id" @hash["short_name"] = "short_name" end @hash end |