Class: Unit::Card::PatchBusinessVirtualCardRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/card/patch_business_virtual_card_request.rb

Direct Known Subclasses

PatchBusinessVirtualCreditCardRequest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(card_id, address = nil, phone = nil, email = nil, tags = nil, limits = nil) ⇒ PatchBusinessVirtualCardRequest

Returns a new instance of PatchBusinessVirtualCardRequest.

Parameters:

  • card_id (String)
  • address (Address) (defaults to: nil)
    • optional

  • phone (Phone) (defaults to: nil)
    • optional

  • email (String) (defaults to: nil)
    • optional

  • tags (Hash) (defaults to: nil)
    • optional

  • limits (Hash) (defaults to: nil)
    • optional



16
17
18
19
20
21
22
23
24
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 16

def initialize(card_id, address = nil, phone = nil, email = nil, tags = nil, limits = nil)
  @card_id = card_id
  @address = address
  @phone = phone
  @email = email
  @tags = tags
  @limits = limits
  @type = "businessVirtualDebitCard"
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



8
9
10
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 8

def address
  @address
end

#card_idObject (readonly)

Returns the value of attribute card_id.



8
9
10
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 8

def card_id
  @card_id
end

#emailObject (readonly)

Returns the value of attribute email.



8
9
10
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 8

def email
  @email
end

#limitsObject (readonly)

Returns the value of attribute limits.



8
9
10
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 8

def limits
  @limits
end

#phoneObject (readonly)

Returns the value of attribute phone.



8
9
10
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 8

def phone
  @phone
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 8

def tags
  @tags
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 8

def type
  @type
end

Instance Method Details

#to_json_apiObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/unit/models/card/patch_business_virtual_card_request.rb', line 26

def to_json_api
  payload = {
    "data": {
      "type": type,
      "attributes": {
        "address": address,
        "phone": phone,
        "email": email,
        "tags": tags,
        "limits": limits
      }.compact
    }
  }
  payload.to_json
end