Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::ProductTypeGroup
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::ProductTypeGroup
- Defined in:
- lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb
Overview
ProductTypeGroup Model.
Instance Attribute Summary collapse
-
#department ⇒ Array[Department]
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#product_type ⇒ Array[ProductType]
TODO: Write general description for this method.
-
#product_type_group_name ⇒ 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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(product_type_group_name = nil, description = nil, product_type = nil, department = nil) ⇒ ProductTypeGroup
constructor
A new instance of ProductTypeGroup.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(product_type_group_name = nil, description = nil, product_type = nil, department = nil) ⇒ ProductTypeGroup
Returns a new instance of ProductTypeGroup.
49 50 51 52 53 54 55 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 49 def initialize(product_type_group_name = nil, description = nil, product_type = nil, department = nil) @product_type_group_name = product_type_group_name @description = description @product_type = product_type @department = department end |
Instance Attribute Details
#department ⇒ Array[Department]
TODO: Write general description for this method
27 28 29 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 27 def department @department end |
#description ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 19 def description @description end |
#product_type ⇒ Array[ProductType]
TODO: Write general description for this method
23 24 25 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 23 def product_type @product_type end |
#product_type_group_name ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 15 def product_type_group_name @product_type_group_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. product_type_group_name = hash.key?('productTypeGroupName') ? hash['productTypeGroupName'] : nil description = hash.key?('description') ? hash['description'] : nil # Parameter is an array, so we need to iterate through it product_type = nil unless hash['productType'].nil? product_type = [] hash['productType'].each do |structure| product_type << (ProductType.from_hash(structure) if structure) end end product_type = nil unless hash.key?('productType') # Parameter is an array, so we need to iterate through it department = nil unless hash['department'].nil? department = [] hash['department'].each do |structure| department << (Department.from_hash(structure) if structure) end end department = nil unless hash.key?('department') # Create object from extracted values. ProductTypeGroup.new(product_type_group_name, description, product_type, department) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['product_type_group_name'] = 'productTypeGroupName' @_hash['description'] = 'description' @_hash['product_type'] = 'productType' @_hash['department'] = 'department' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 40 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
101 102 103 104 105 106 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} product_type_group_name: #{@product_type_group_name.inspect}, description:"\ " #{@description.inspect}, product_type: #{@product_type.inspect}, department:"\ " #{@department.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/product_type_group.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} product_type_group_name: #{@product_type_group_name}, description:"\ " #{@description}, product_type: #{@product_type}, department: #{@department}>" end |