Class: ShellCardManagementApIs::ProductAllOf0

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/product_all_of0.rb

Overview

ProductAllOf0 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(global_product_code = nil, description = nil) ⇒ ProductAllOf0

Returns a new instance of ProductAllOf0.



42
43
44
45
# File 'lib/shell_card_management_ap_is/models/product_all_of0.rb', line 42

def initialize(global_product_code = nil, description = nil)
  @global_product_code = global_product_code
  @description = description
end

Instance Attribute Details

#descriptionString

The description returned by the Gateway API.

Returns:

  • (String)


19
20
21
# File 'lib/shell_card_management_ap_is/models/product_all_of0.rb', line 19

def description
  @description
end

#global_product_codeString

The productCode returned by the Gateway API. Example: 021

Returns:

  • (String)


15
16
17
# File 'lib/shell_card_management_ap_is/models/product_all_of0.rb', line 15

def global_product_code
  @global_product_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/shell_card_management_ap_is/models/product_all_of0.rb', line 48

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  global_product_code =
    hash.key?('GlobalProductCode') ? hash['GlobalProductCode'] : nil
  description = hash.key?('Description') ? hash['Description'] : nil

  # Create object from extracted values.
  ProductAllOf0.new(global_product_code,
                    description)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
27
# File 'lib/shell_card_management_ap_is/models/product_all_of0.rb', line 22

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['global_product_code'] = 'GlobalProductCode'
  @_hash['description'] = 'Description'
  @_hash
end

.nullablesObject

An array for nullable fields



35
36
37
38
39
40
# File 'lib/shell_card_management_ap_is/models/product_all_of0.rb', line 35

def self.nullables
  %w[
    global_product_code
    description
  ]
end

.optionalsObject

An array for optional fields



30
31
32
# File 'lib/shell_card_management_ap_is/models/product_all_of0.rb', line 30

def self.optionals
  []
end