Class: ShellCardManagementApIs::Datum
- Defined in:
- lib/shell_card_management_ap_is/models/datum.rb
Overview
Datum Model.
Instance Attribute Summary collapse
-
#account_id ⇒ Integer
Account id.
-
#account_number ⇒ String
Account number.
-
#card_id ⇒ Integer
Card Id.
-
#card_pan ⇒ String
PAN of the card.
-
#reference_id ⇒ Integer
Individual delivery address update reference number for the delivery address update request.
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(card_id = SKIP, card_pan = SKIP, account_id = SKIP, account_number = SKIP, reference_id = SKIP) ⇒ Datum
constructor
A new instance of Datum.
-
#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(card_id = SKIP, card_pan = SKIP, account_id = SKIP, account_number = SKIP, reference_id = SKIP) ⇒ Datum
Returns a new instance of Datum.
64 65 66 67 68 69 70 71 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 64 def initialize(card_id = SKIP, card_pan = SKIP, account_id = SKIP, account_number = SKIP, reference_id = SKIP) @card_id = card_id unless card_id == SKIP @card_pan = card_pan unless card_pan == SKIP @account_id = account_id unless account_id == SKIP @account_number = account_number unless account_number == SKIP @reference_id = reference_id unless reference_id == SKIP end |
Instance Attribute Details
#account_id ⇒ Integer
Account id
22 23 24 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 22 def account_id @account_id end |
#account_number ⇒ String
Account number
26 27 28 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 26 def account_number @account_number end |
#card_id ⇒ Integer
Card Id.
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 14 def card_id @card_id end |
#card_pan ⇒ String
PAN of the card.
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 18 def card_pan @card_pan end |
#reference_id ⇒ Integer
Individual delivery address update reference number for the delivery address update request.
31 32 33 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 31 def reference_id @reference_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card_id = hash.key?('CardId') ? hash['CardId'] : SKIP card_pan = hash.key?('CardPAN') ? hash['CardPAN'] : SKIP account_id = hash.key?('AccountId') ? hash['AccountId'] : SKIP account_number = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP reference_id = hash.key?('ReferenceId') ? hash['ReferenceId'] : SKIP # Create object from extracted values. Datum.new(card_id, card_pan, account_id, account_number, reference_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['card_id'] = 'CardId' @_hash['card_pan'] = 'CardPAN' @_hash['account_id'] = 'AccountId' @_hash['account_number'] = 'AccountNumber' @_hash['reference_id'] = 'ReferenceId' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 59 60 61 62 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 56 def self.nullables %w[ card_id card_pan account_id ] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 45 def self.optionals %w[ card_id card_pan account_id account_number reference_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
100 101 102 103 104 105 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 100 def inspect class_name = self.class.name.split('::').last "<#{class_name} card_id: #{@card_id.inspect}, card_pan: #{@card_pan.inspect}, account_id:"\ " #{@account_id.inspect}, account_number: #{@account_number.inspect}, reference_id:"\ " #{@reference_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
93 94 95 96 97 |
# File 'lib/shell_card_management_ap_is/models/datum.rb', line 93 def to_s class_name = self.class.name.split('::').last "<#{class_name} card_id: #{@card_id}, card_pan: #{@card_pan}, account_id: #{@account_id},"\ " account_number: #{@account_number}, reference_id: #{@reference_id}>" end |