Class: ShellCardManagementApIs::NetworkRestriction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::NetworkRestriction
- Defined in:
- lib/shell_card_management_ap_is/models/network_restriction.rb
Overview
NetworkRestriction Model.
Instance Attribute Summary collapse
-
#country ⇒ String
ISO 3166-1 Numeric-3 code of the country where the network restriction is applied.
-
#exclusive ⇒ TrueClass | FalseClass
Flag indicates whether the profile is inclusive or exclusive.
-
#networks ⇒ Array[String]
A list of Gateway network codes, typically 7 or 10 digits.
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(country = SKIP, networks = SKIP, exclusive = SKIP) ⇒ NetworkRestriction
constructor
A new instance of NetworkRestriction.
Methods inherited from BaseModel
Constructor Details
#initialize(country = SKIP, networks = SKIP, exclusive = SKIP) ⇒ NetworkRestriction
Returns a new instance of NetworkRestriction.
54 55 56 57 58 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 54 def initialize(country = SKIP, networks = SKIP, exclusive = SKIP) @country = country unless country == SKIP @networks = networks unless networks == SKIP @exclusive = exclusive unless exclusive == SKIP end |
Instance Attribute Details
#country ⇒ String
ISO 3166-1 Numeric-3 code of the country where the network restriction is applied. Example: 826 for United Kingdom.
16 17 18 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 16 def country @country end |
#exclusive ⇒ TrueClass | FalseClass
Flag indicates whether the profile is inclusive or exclusive. Example: False - (inclusive), i.e. the “Networks” property lists the networks in which the transaction will be allowed. True - (exclusive), i.e. the “Networks” property lists the networks in which the transactions will be declined.
29 30 31 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 29 def exclusive @exclusive end |
#networks ⇒ Array[String]
A list of Gateway network codes, typically 7 or 10 digits. Example: 0002003250
21 22 23 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 21 def networks @networks end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country = hash.key?('Country') ? hash['Country'] : SKIP networks = hash.key?('Networks') ? hash['Networks'] : SKIP exclusive = hash.key?('Exclusive') ? hash['Exclusive'] : SKIP # Create object from extracted values. NetworkRestriction.new(country, networks, exclusive) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['country'] = 'Country' @_hash['networks'] = 'Networks' @_hash['exclusive'] = 'Exclusive' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 47 |
# File 'lib/shell_card_management_ap_is/models/network_restriction.rb', line 41 def self.optionals %w[ country networks exclusive ] end |