Class: ShellCardManagementApIs::CardDayTimeRestrictions
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CardDayTimeRestrictions
- Defined in:
- lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb
Overview
CardDayTimeRestrictions Model.
Instance Attribute Summary collapse
-
#friday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Fridays or not.
-
#level ⇒ String
Describes at which level the restriction is set at.
-
#monday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Mondays or not.
-
#saturday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Saturdays or not.
-
#sunday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Sundays or not.
-
#thursday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Thursdays or not.
-
#time_from ⇒ String
The time in the day from when the transaction is allowed.
-
#time_to ⇒ String
allowed.
-
#tuesday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Tuesdays or not.
-
#wednesday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Wednesdays or not.
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(level = SKIP, monday = SKIP, tuesday = SKIP, wednesday = SKIP, thursday = SKIP, friday = SKIP, saturday = SKIP, sunday = SKIP, time_from = SKIP, time_to = SKIP) ⇒ CardDayTimeRestrictions
constructor
A new instance of CardDayTimeRestrictions.
Methods inherited from BaseModel
Constructor Details
#initialize(level = SKIP, monday = SKIP, tuesday = SKIP, wednesday = SKIP, thursday = SKIP, friday = SKIP, saturday = SKIP, sunday = SKIP, time_from = SKIP, time_to = SKIP) ⇒ CardDayTimeRestrictions
Returns a new instance of CardDayTimeRestrictions.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 108 def initialize(level = SKIP, monday = SKIP, tuesday = SKIP, wednesday = SKIP, thursday = SKIP, friday = SKIP, saturday = SKIP, sunday = SKIP, time_from = SKIP, time_to = SKIP) @level = level unless level == SKIP @monday = monday unless monday == SKIP @tuesday = tuesday unless tuesday == SKIP @wednesday = wednesday unless wednesday == SKIP @thursday = thursday unless thursday == SKIP @friday = friday unless friday == SKIP @saturday = saturday unless saturday == SKIP @sunday = sunday unless sunday == SKIP @time_from = time_from unless time_from == SKIP @time_to = time_to unless time_to == SKIP end |
Instance Attribute Details
#friday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Fridays or not.
37 38 39 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 37 def friday @friday end |
#level ⇒ String
Describes at which level the restriction is set at. Possible values: OU = Restriction set at ColCo card type Customer = Restriction set at customer card type
17 18 19 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 17 def level @level end |
#monday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Mondays or not.
21 22 23 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 21 def monday @monday end |
#saturday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Saturdays or not.
41 42 43 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 41 def saturday @saturday end |
#sunday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Sundays or not.
45 46 47 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 45 def sunday @sunday end |
#thursday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Thursdays or not.
33 34 35 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 33 def thursday @thursday end |
#time_from ⇒ String
The time in the day from when the transaction is allowed. Format: HH:mm: ss E.g., 21:00:00 Note: 1) The client application has to convert the value to the required date-time data type. 2) The value will be 00:00:00 when no restriction set for this field.
55 56 57 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 55 def time_from @time_from end |
#time_to ⇒ String
allowed. Format: HH:mm: ss E.g., 21:00:00 Note: 1) The client application has to convert the value to the required date-time data type. 2) The value will be 00:00:00 when no restriction set for this field.
65 66 67 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 65 def time_to @time_to end |
#tuesday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Tuesdays or not.
25 26 27 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 25 def tuesday @tuesday end |
#wednesday ⇒ TrueClass | FalseClass
Whether the transaction is allowed on Wednesdays or not.
29 30 31 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 29 def wednesday @wednesday end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 125 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. level = hash.key?('Level') ? hash['Level'] : SKIP monday = hash.key?('Monday') ? hash['Monday'] : SKIP tuesday = hash.key?('Tuesday') ? hash['Tuesday'] : SKIP wednesday = hash.key?('Wednesday') ? hash['Wednesday'] : SKIP thursday = hash.key?('Thursday') ? hash['Thursday'] : SKIP friday = hash.key?('Friday') ? hash['Friday'] : SKIP saturday = hash.key?('Saturday') ? hash['Saturday'] : SKIP sunday = hash.key?('Sunday') ? hash['Sunday'] : SKIP time_from = hash.key?('TimeFrom') ? hash['TimeFrom'] : SKIP time_to = hash.key?('TimeTo') ? hash['TimeTo'] : SKIP # Create object from extracted values. CardDayTimeRestrictions.new(level, monday, tuesday, wednesday, thursday, friday, saturday, sunday, time_from, time_to) end |
.names ⇒ Object
A mapping from model property names to API property names.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 68 def self.names @_hash = {} if @_hash.nil? @_hash['level'] = 'Level' @_hash['monday'] = 'Monday' @_hash['tuesday'] = 'Tuesday' @_hash['wednesday'] = 'Wednesday' @_hash['thursday'] = 'Thursday' @_hash['friday'] = 'Friday' @_hash['saturday'] = 'Saturday' @_hash['sunday'] = 'Sunday' @_hash['time_from'] = 'TimeFrom' @_hash['time_to'] = 'TimeTo' @_hash end |
.nullables ⇒ Object
An array for nullable fields
100 101 102 103 104 105 106 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 100 def self.nullables %w[ level time_from time_to ] end |
.optionals ⇒ Object
An array for optional fields
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/shell_card_management_ap_is/models/card_day_time_restrictions.rb', line 84 def self.optionals %w[ level monday tuesday wednesday thursday friday saturday sunday time_from time_to ] end |