Class: ShellCardManagementApIs::SearchCard
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::SearchCard
- Defined in:
- lib/shell_card_management_ap_is/models/search_card.rb
Overview
SearchCard
Instance Attribute Summary collapse
-
#card_id ⇒ Integer
Unique Card Id Optional if PAN is given, else mandatory.
-
#pan ⇒ String
Card PAN.
-
#panid ⇒ Float
Card PANID optional id cardid given, else mandatory Note: PANID is ignored if CardId is given.
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, panid = SKIP) ⇒ SearchCard
constructor
A new instance of SearchCard.
Methods inherited from BaseModel
Constructor Details
#initialize(card_id = SKIP, pan = SKIP, panid = SKIP) ⇒ SearchCard
Returns a new instance of SearchCard.
55 56 57 58 59 |
# File 'lib/shell_card_management_ap_is/models/search_card.rb', line 55 def initialize(card_id = SKIP, pan = SKIP, panid = SKIP) @card_id = card_id unless card_id == SKIP @pan = pan unless pan == SKIP @panid = panid unless panid == 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.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.
21 22 23 |
# File 'lib/shell_card_management_ap_is/models/search_card.rb', line 21 def pan @pan end |
#panid ⇒ Float
Card PANID
optional id cardid given, else mandatory
Note: PANID is ignored if CardId is given.
27 28 29 |
# File 'lib/shell_card_management_ap_is/models/search_card.rb', line 27 def panid @panid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/shell_card_management_ap_is/models/search_card.rb', line 62 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 panid = hash.key?('PANID') ? hash['PANID'] : SKIP # Create object from extracted values. SearchCard.new(card_id, pan, panid) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 |
# File 'lib/shell_card_management_ap_is/models/search_card.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['card_id'] = 'CardId' @_hash['pan'] = 'PAN' @_hash['panid'] = 'PANID' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 51 52 53 |
# File 'lib/shell_card_management_ap_is/models/search_card.rb', line 48 def self.nullables %w[ card_id pan ] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 |
# File 'lib/shell_card_management_ap_is/models/search_card.rb', line 39 def self.optionals %w[ card_id pan panid ] end |