Class: ShellCardManagementApIs::CardBundle
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CardBundle
- Defined in:
- lib/shell_card_management_ap_is/models/card_bundle.rb
Overview
CardBundle Model.
Instance Attribute Summary collapse
-
#bundle_id ⇒ String
Unique identifier for the Card Bundle.
-
#description ⇒ String
DescriptionCard Bundle Description.
-
#external_bundle_id ⇒ String
External system allocated Card Bundle identifier for Card Bundle.
-
#total_cards ⇒ Integer
No of Card PAN added to the card bundle.
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(bundle_id = SKIP, external_bundle_id = SKIP, description = SKIP, total_cards = SKIP) ⇒ CardBundle
constructor
A new instance of CardBundle.
Methods inherited from BaseModel
Constructor Details
#initialize(bundle_id = SKIP, external_bundle_id = SKIP, description = SKIP, total_cards = SKIP) ⇒ CardBundle
Returns a new instance of CardBundle.
53 54 55 56 57 58 59 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 53 def initialize(bundle_id = SKIP, external_bundle_id = SKIP, description = SKIP, total_cards = SKIP) @bundle_id = bundle_id unless bundle_id == SKIP @external_bundle_id = external_bundle_id unless external_bundle_id == SKIP @description = description unless description == SKIP @total_cards = total_cards unless total_cards == SKIP end |
Instance Attribute Details
#bundle_id ⇒ String
Unique identifier for the Card Bundle
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 14 def bundle_id @bundle_id end |
#description ⇒ String
DescriptionCard Bundle Description.
22 23 24 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 22 def description @description end |
#external_bundle_id ⇒ String
External system allocated Card Bundle identifier for Card Bundle.
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 18 def external_bundle_id @external_bundle_id end |
#total_cards ⇒ Integer
No of Card PAN added to the card bundle.
26 27 28 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 26 def total_cards @total_cards 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 75 76 77 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. bundle_id = hash.key?('BundleId') ? hash['BundleId'] : SKIP external_bundle_id = hash.key?('ExternalBundleId') ? hash['ExternalBundleId'] : SKIP description = hash.key?('Description') ? hash['Description'] : SKIP total_cards = hash.key?('TotalCards') ? hash['TotalCards'] : SKIP # Create object from extracted values. CardBundle.new(bundle_id, external_bundle_id, description, total_cards) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['bundle_id'] = 'BundleId' @_hash['external_bundle_id'] = 'ExternalBundleId' @_hash['description'] = 'Description' @_hash['total_cards'] = 'TotalCards' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/shell_card_management_ap_is/models/card_bundle.rb', line 39 def self.optionals %w[ bundle_id external_bundle_id description total_cards ] end |