Class: Paymos::Payment

Inherits:
Model
  • Object
show all
Defined in:
lib/paymos/models.rb,
sig/paymos.rbs

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

#[], deep_freeze, fields, #initialize, #to_h

Constructor Details

This class inherits a constructor from Paymos::Model

Instance Attribute Details

#addressString? (readonly)

Returns the value of attribute address.

Returns:

  • (String, nil)


77
78
79
# File 'sig/paymos.rbs', line 77

def address
  @address
end

#chain_idInteger (readonly)

Returns the value of attribute chain_id.

Returns:

  • (Integer)


74
75
76
# File 'sig/paymos.rbs', line 74

def chain_id
  @chain_id
end

#contract_addressString? (readonly)

Returns the value of attribute contract_address.

Returns:

  • (String, nil)


75
76
77
# File 'sig/paymos.rbs', line 75

def contract_address
  @contract_address
end

#currencyString (readonly)

Returns the value of attribute currency.

Returns:

  • (String)


72
73
74
# File 'sig/paymos.rbs', line 72

def currency
  @currency
end

#exchange_rateString? (readonly)

Returns the value of attribute exchange_rate.

Returns:

  • (String, nil)


78
79
80
# File 'sig/paymos.rbs', line 78

def exchange_rate
  @exchange_rate
end

#expectedString (readonly)

Returns the value of attribute expected.

Returns:

  • (String)


76
77
78
# File 'sig/paymos.rbs', line 76

def expected
  @expected
end

#feeString? (readonly)

Returns the value of attribute fee.

Returns:

  • (String, nil)


81
82
83
# File 'sig/paymos.rbs', line 81

def fee
  @fee
end

#netString? (readonly)

Returns the value of attribute net.

Returns:

  • (String, nil)


82
83
84
# File 'sig/paymos.rbs', line 82

def net
  @net
end

#networkString (readonly)

Returns the value of attribute network.

Returns:

  • (String)


73
74
75
# File 'sig/paymos.rbs', line 73

def network
  @network
end

Returns the value of attribute paid.

Returns:

  • (String, nil)


79
80
81
# File 'sig/paymos.rbs', line 79

def paid
  @paid
end

#remainingString? (readonly)

Returns the value of attribute remaining.

Returns:

  • (String, nil)


80
81
82
# File 'sig/paymos.rbs', line 80

def remaining
  @remaining
end

#transfersArray[Transfer]? (readonly)

Returns the value of attribute transfers.

Returns:



83
84
85
# File 'sig/paymos.rbs', line 83

def transfers
  @transfers
end

Class Method Details

.from(value) ⇒ Object



93
94
95
96
97
# File 'lib/paymos/models.rb', line 93

def self.from(value)
  model = super
  transfers = model.transfers&.map { |item| Transfer.from(item) }
  new(**model.to_h, transfers: transfers)
end