Class: Raas::UnregisterCreditCardResponseModel

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/raas/models/unregister_credit_card_response_model.rb

Overview

Represents the response from the unregister credit card call

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(created_date = nil, message = nil, token = nil) ⇒ UnregisterCreditCardResponseModel

Returns a new instance of UnregisterCreditCardResponseModel.



29
30
31
32
33
34
35
# File 'lib/raas/models/unregister_credit_card_response_model.rb', line 29

def initialize(created_date = nil,
               message = nil,
               token = nil)
  @created_date = created_date
  @message = message
  @token = token
end

Instance Attribute Details

#created_dateDateTime

The date the card was removed

Returns:

  • (DateTime)


10
11
12
# File 'lib/raas/models/unregister_credit_card_response_model.rb', line 10

def created_date
  @created_date
end

#messageString

A message describing the status of the card

Returns:



14
15
16
# File 'lib/raas/models/unregister_credit_card_response_model.rb', line 14

def message
  @message
end

#tokenString

The credit card token

Returns:



18
19
20
# File 'lib/raas/models/unregister_credit_card_response_model.rb', line 18

def token
  @token
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/raas/models/unregister_credit_card_response_model.rb', line 38

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  created_date = APIHelper.rfc3339(hash['createdDate']) if
    hash['createdDate']
  message = hash['message']
  token = hash['token']

  # Create object from extracted values.
  UnregisterCreditCardResponseModel.new(created_date,
                                        message,
                                        token)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
27
# File 'lib/raas/models/unregister_credit_card_response_model.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_date'] = 'createdDate'
  @_hash['message'] = 'message'
  @_hash['token'] = 'token'
  @_hash
end