Class: ShellCardManagementApIs::CardBlockSchedule

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/card_block_schedule.rb

Overview

Response entity object for CardBlockSchedule list

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(from_date = SKIP, to_date = SKIP) ⇒ CardBlockSchedule

Returns a new instance of CardBlockSchedule.



46
47
48
49
# File 'lib/shell_card_management_ap_is/models/card_block_schedule.rb', line 46

def initialize(from_date = SKIP, to_date = SKIP)
  @from_date = from_date unless from_date == SKIP
  @to_date = to_date unless to_date == SKIP
end

Instance Attribute Details

#from_dateString

Effective start date of Block / Unblock<br /> Format: yyyyMMdd

Returns:

  • (String)


15
16
17
# File 'lib/shell_card_management_ap_is/models/card_block_schedule.rb', line 15

def from_date
  @from_date
end

#to_dateString

Effective end date of Block / Unblock<br /> Format: yyyyMMdd

Returns:

  • (String)


20
21
22
# File 'lib/shell_card_management_ap_is/models/card_block_schedule.rb', line 20

def to_date
  @to_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/shell_card_management_ap_is/models/card_block_schedule.rb', line 52

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  from_date = hash.key?('FromDate') ? hash['FromDate'] : SKIP
  to_date = hash.key?('ToDate') ? hash['ToDate'] : SKIP

  # Create object from extracted values.
  CardBlockSchedule.new(from_date,
                        to_date)
end

.namesObject

A mapping from model property names to API property names.



23
24
25
26
27
28
# File 'lib/shell_card_management_ap_is/models/card_block_schedule.rb', line 23

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash
end

.nullablesObject

An array for nullable fields



39
40
41
42
43
44
# File 'lib/shell_card_management_ap_is/models/card_block_schedule.rb', line 39

def self.nullables
  %w[
    from_date
    to_date
  ]
end

.optionalsObject

An array for optional fields



31
32
33
34
35
36
# File 'lib/shell_card_management_ap_is/models/card_block_schedule.rb', line 31

def self.optionals
  %w[
    from_date
    to_date
  ]
end