Class: ShellCardManagementApIs::CustomerContract
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CustomerContract
- Defined in:
- lib/shell_card_management_ap_is/models/customer_contract.rb
Overview
CustomerContract Model.
Instance Attribute Summary collapse
-
#partner_id ⇒ String
Partner Id in e-TM system.
-
#partner_name ⇒ String
Partner Name in e-TM system.
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(partner_id = SKIP, partner_name = SKIP) ⇒ CustomerContract
constructor
A new instance of CustomerContract.
Methods inherited from BaseModel
Constructor Details
#initialize(partner_id = SKIP, partner_name = SKIP) ⇒ CustomerContract
Returns a new instance of CustomerContract.
44 45 46 47 |
# File 'lib/shell_card_management_ap_is/models/customer_contract.rb', line 44 def initialize(partner_id = SKIP, partner_name = SKIP) @partner_id = partner_id unless partner_id == SKIP @partner_name = partner_name unless partner_name == SKIP end |
Instance Attribute Details
#partner_id ⇒ String
Partner Id in e-TM system
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/customer_contract.rb', line 14 def partner_id @partner_id end |
#partner_name ⇒ String
Partner Name in e-TM system
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/customer_contract.rb', line 18 def partner_name @partner_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/shell_card_management_ap_is/models/customer_contract.rb', line 50 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. partner_id = hash.key?('PartnerId') ? hash['PartnerId'] : SKIP partner_name = hash.key?('PartnerName') ? hash['PartnerName'] : SKIP # Create object from extracted values. CustomerContract.new(partner_id, partner_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/shell_card_management_ap_is/models/customer_contract.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['partner_id'] = 'PartnerId' @_hash['partner_name'] = 'PartnerName' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 40 41 42 |
# File 'lib/shell_card_management_ap_is/models/customer_contract.rb', line 37 def self.nullables %w[ partner_id partner_name ] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 34 |
# File 'lib/shell_card_management_ap_is/models/customer_contract.rb', line 29 def self.optionals %w[ partner_id partner_name ] end |