Class: ShellDataReportingApIs::FeeRuleProduct
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::FeeRuleProduct
- Defined in:
- lib/shell_data_reporting_ap_is/models/fee_rule_product.rb
Overview
FeeRuleProduct Model.
Instance Attribute Summary collapse
-
#product_code ⇒ String
Client Product Code.
-
#product_group_id ⇒ Integer
Product Group Id.
-
#product_group_name ⇒ String
Product Group name.
-
#product_id ⇒ Integer
Product Id.
-
#product_name ⇒ String
Product name in English.
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_group_id = SKIP, product_group_name = SKIP, product_code = SKIP, product_id = SKIP, product_name = SKIP) ⇒ FeeRuleProduct
constructor
A new instance of FeeRuleProduct.
-
#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_group_id = SKIP, product_group_name = SKIP, product_code = SKIP, product_id = SKIP, product_name = SKIP) ⇒ FeeRuleProduct
Returns a new instance of FeeRuleProduct.
65 66 67 68 69 70 71 72 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 65 def initialize(product_group_id = SKIP, product_group_name = SKIP, product_code = SKIP, product_id = SKIP, product_name = SKIP) @product_group_id = product_group_id unless product_group_id == SKIP @product_group_name = product_group_name unless product_group_name == SKIP @product_code = product_code unless product_code == SKIP @product_id = product_id unless product_id == SKIP @product_name = product_name unless product_name == SKIP end |
Instance Attribute Details
#product_code ⇒ String
Client Product Code
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 22 def product_code @product_code end |
#product_group_id ⇒ Integer
Product Group Id
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 14 def product_group_id @product_group_id end |
#product_group_name ⇒ String
Product Group name
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 18 def product_group_name @product_group_name end |
#product_id ⇒ Integer
Product Id
26 27 28 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 26 def product_id @product_id end |
#product_name ⇒ String
Product name in English
30 31 32 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 30 def product_name @product_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. product_group_id = hash.key?('ProductGroupId') ? hash['ProductGroupId'] : SKIP product_group_name = hash.key?('ProductGroupName') ? hash['ProductGroupName'] : SKIP product_code = hash.key?('ProductCode') ? hash['ProductCode'] : SKIP product_id = hash.key?('ProductId') ? hash['ProductId'] : SKIP product_name = hash.key?('ProductName') ? hash['ProductName'] : SKIP # Create object from extracted values. FeeRuleProduct.new(product_group_id, product_group_name, product_code, product_id, product_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['product_group_id'] = 'ProductGroupId' @_hash['product_group_name'] = 'ProductGroupName' @_hash['product_code'] = 'ProductCode' @_hash['product_id'] = 'ProductId' @_hash['product_name'] = 'ProductName' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 58 59 60 61 62 63 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 55 def self.nullables %w[ product_group_id product_group_name product_code product_id product_name ] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 44 def self.optionals %w[ product_group_id product_group_name product_code product_id product_name ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 109 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} product_group_id: #{@product_group_id.inspect}, product_group_name:"\ " #{@product_group_name.inspect}, product_code: #{@product_code.inspect}, product_id:"\ " #{@product_id.inspect}, product_name: #{@product_name.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
96 97 98 99 100 101 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_product.rb', line 96 def to_s class_name = self.class.name.split('::').last "<#{class_name} product_group_id: #{@product_group_id}, product_group_name:"\ " #{@product_group_name}, product_code: #{@product_code}, product_id: #{@product_id},"\ " product_name: #{@product_name}>" end |