Class: ShellCardManagementApIs::SearchCardRestriction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::SearchCardRestriction
- Defined in:
- lib/shell_card_management_ap_is/models/search_card_restriction.rb
Overview
SearchCardRestriction Model.
Instance Attribute Summary collapse
-
#card_id ⇒ Integer
Unique Card Id Optional if PAN is given, else mandatory.
-
#pan ⇒ String
Card PAN.
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, pan = SKIP) ⇒ SearchCardRestriction
constructor
A new instance of SearchCardRestriction.
Methods inherited from BaseModel
Constructor Details
#initialize(card_id = SKIP, pan = SKIP) ⇒ SearchCardRestriction
Returns a new instance of SearchCardRestriction.
48 49 50 51 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 48 def initialize(card_id = SKIP, pan = SKIP) @card_id = card_id unless card_id == SKIP @pan = pan unless pan == SKIP end |
Instance Attribute Details
#card_id ⇒ Integer
Unique Card Id Optional if PAN is given, else mandatory.
15 16 17 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 15 def card_id @card_id end |
#pan ⇒ String
Card PAN. Optional if CardId is given, else mandatory. Note: PAN is ignored if CardId is given. Example: 7002051006629890645
22 23 24 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 22 def pan @pan end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 54 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card_id = hash.key?('CardId') ? hash['CardId'] : SKIP pan = hash.key?('PAN') ? hash['PAN'] : SKIP # Create object from extracted values. SearchCardRestriction.new(card_id, pan) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['card_id'] = 'CardId' @_hash['pan'] = 'PAN' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 44 45 46 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 41 def self.nullables %w[ card_id pan ] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 38 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 33 def self.optionals %w[ card_id pan ] end |