Class: ShellCardManagementApIs::CreateCardResponse

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

Overview

This entity models the data that is sent in the http response body for this operation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(driver_and_vrn = SKIP, order_card_reference = SKIP) ⇒ CreateCardResponse

Returns a new instance of CreateCardResponse.



45
46
47
48
# File 'lib/shell_card_management_ap_is/models/create_card_response.rb', line 45

def initialize(driver_and_vrn = SKIP, order_card_reference = SKIP)
  @driver_and_vrn = driver_and_vrn unless driver_and_vrn == SKIP
  @order_card_reference = order_card_reference unless order_card_reference == SKIP
end

Instance Attribute Details

#driver_and_vrnString

Driver and VRN of the card. ;( semicolon) is used as delimiter

Returns:

  • (String)


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

def driver_and_vrn
  @driver_and_vrn
end

#order_card_referenceInteger

Reference number for each individual card in the order

Returns:

  • (Integer)


19
20
21
# File 'lib/shell_card_management_ap_is/models/create_card_response.rb', line 19

def order_card_reference
  @order_card_reference
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  driver_and_vrn = hash.key?('DriverAndVRN') ? hash['DriverAndVRN'] : SKIP
  order_card_reference =
    hash.key?('OrderCardReference') ? hash['OrderCardReference'] : SKIP

  # Create object from extracted values.
  CreateCardResponse.new(driver_and_vrn,
                         order_card_reference)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['driver_and_vrn'] = 'DriverAndVRN'
  @_hash['order_card_reference'] = 'OrderCardReference'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    driver_and_vrn
    order_card_reference
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    driver_and_vrn
    order_card_reference
  ]
end