Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Node
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Node
- Defined in:
- lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb
Overview
Node Model.
Instance Attribute Summary collapse
-
#avail_to_sell_qty ⇒ Quantity
TODO: Write general description for this method.
-
#errors ⇒ Array[Error]
TODO: Write general description for this method.
-
#input_qty ⇒ Quantity
TODO: Write general description for this method.
-
#inventory_available_date ⇒ String
TODO: Write general description for this method.
-
#reserved_qty ⇒ Quantity
TODO: Write general description for this method.
-
#ship_node ⇒ 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(ship_node = nil, input_qty = nil, avail_to_sell_qty = nil, errors = nil, inventory_available_date = nil, reserved_qty = nil) ⇒ Node
constructor
A new instance of Node.
-
#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(ship_node = nil, input_qty = nil, avail_to_sell_qty = nil, errors = nil, inventory_available_date = nil, reserved_qty = nil) ⇒ Node
Returns a new instance of Node.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 59 def initialize(ship_node = nil, input_qty = nil, avail_to_sell_qty = nil, errors = nil, inventory_available_date = nil, reserved_qty = nil) @ship_node = ship_node @input_qty = input_qty @avail_to_sell_qty = avail_to_sell_qty @errors = errors @inventory_available_date = inventory_available_date @reserved_qty = reserved_qty end |
Instance Attribute Details
#avail_to_sell_qty ⇒ Quantity
TODO: Write general description for this method
23 24 25 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 23 def avail_to_sell_qty @avail_to_sell_qty end |
#errors ⇒ Array[Error]
TODO: Write general description for this method
27 28 29 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 27 def errors @errors end |
#input_qty ⇒ Quantity
TODO: Write general description for this method
19 20 21 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 19 def input_qty @input_qty end |
#inventory_available_date ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 31 def inventory_available_date @inventory_available_date end |
#reserved_qty ⇒ Quantity
TODO: Write general description for this method
35 36 37 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 35 def reserved_qty @reserved_qty end |
#ship_node ⇒ 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/node.rb', line 15 def ship_node @ship_node end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 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 97 98 99 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ship_node = hash.key?('shipNode') ? hash['shipNode'] : nil input_qty = Quantity.from_hash(hash['inputQty']) if hash['inputQty'] avail_to_sell_qty = Quantity.from_hash(hash['availToSellQty']) if hash['availToSellQty'] # Parameter is an array, so we need to iterate through it errors = nil unless hash['errors'].nil? errors = [] hash['errors'].each do |structure| errors << (Error.from_hash(structure) if structure) end end errors = nil unless hash.key?('errors') inventory_available_date = hash.key?('inventoryAvailableDate') ? hash['inventoryAvailableDate'] : nil reserved_qty = Quantity.from_hash(hash['reservedQty']) if hash['reservedQty'] # Create object from extracted values. Node.new(ship_node, input_qty, avail_to_sell_qty, errors, inventory_available_date, reserved_qty) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['ship_node'] = 'shipNode' @_hash['input_qty'] = 'inputQty' @_hash['avail_to_sell_qty'] = 'availToSellQty' @_hash['errors'] = 'errors' @_hash['inventory_available_date'] = 'inventoryAvailableDate' @_hash['reserved_qty'] = 'reservedQty' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 50 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 115 116 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} ship_node: #{@ship_node.inspect}, input_qty: #{@input_qty.inspect},"\ " avail_to_sell_qty: #{@avail_to_sell_qty.inspect}, errors: #{@errors.inspect},"\ " inventory_available_date: #{@inventory_available_date.inspect}, reserved_qty:"\ " #{@reserved_qty.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
102 103 104 105 106 107 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/node.rb', line 102 def to_s class_name = self.class.name.split('::').last "<#{class_name} ship_node: #{@ship_node}, input_qty: #{@input_qty}, avail_to_sell_qty:"\ " #{@avail_to_sell_qty}, errors: #{@errors}, inventory_available_date:"\ " #{@inventory_available_date}, reserved_qty: #{@reserved_qty}>" end |