Class: SimplyWompi::Transactions::Domain::Dtos::CreateTransactionPaymentMethodDto

Inherits:
Object
  • Object
show all
Defined in:
lib/simply_wompi/transactions/domain/dtos/create_transaction_payment_method_dto.rb

Overview

Create Transaction Payment Method Data Transfer Object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, token:, installments:) ⇒ CreateTransactionPaymentMethodDto

Returns a new instance of CreateTransactionPaymentMethodDto.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/simply_wompi/transactions/domain/dtos/create_transaction_payment_method_dto.rb', line 11

def initialize(
  type:,
  token:,
  installments:
)
  unless type.is_a?(String)
    raise ArgumentError("ArgumentError type: #{type.class}, is not instance of #{String}")
  end

  unless token.is_a?(String)
    raise ArgumentError("ArgumentError token: #{token.class}, is not instance of #{String}")
  end

  unless installments.is_a?(Integer)
    raise ArgumentError("ArgumentError installments: #{installments.class}, is not instance of #{Integer}")
  end

  @type = type
  @token = token
  @installments = installments
end

Instance Attribute Details

#installmentsObject (readonly)

Returns the value of attribute installments.



7
8
9
# File 'lib/simply_wompi/transactions/domain/dtos/create_transaction_payment_method_dto.rb', line 7

def installments
  @installments
end

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/simply_wompi/transactions/domain/dtos/create_transaction_payment_method_dto.rb', line 7

def token
  @token
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/simply_wompi/transactions/domain/dtos/create_transaction_payment_method_dto.rb', line 7

def type
  @type
end