Class: X402::Payments::V1::PayloadBuilder
- Inherits:
-
Object
- Object
- X402::Payments::V1::PayloadBuilder
- Defined in:
- lib/x402/payments/v1/payload_builder.rb
Instance Attribute Summary collapse
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
-
#network ⇒ Object
readonly
Returns the value of attribute network.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(authorization:, signature:, scheme:, network:) ⇒ PayloadBuilder
constructor
A new instance of PayloadBuilder.
Constructor Details
#initialize(authorization:, signature:, scheme:, network:) ⇒ PayloadBuilder
Returns a new instance of PayloadBuilder.
9 10 11 12 13 14 |
# File 'lib/x402/payments/v1/payload_builder.rb', line 9 def initialize(authorization:, signature:, scheme:, network:) @authorization = @signature = signature @scheme = scheme @network = network end |
Instance Attribute Details
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
7 8 9 |
# File 'lib/x402/payments/v1/payload_builder.rb', line 7 def @authorization end |
#network ⇒ Object (readonly)
Returns the value of attribute network.
7 8 9 |
# File 'lib/x402/payments/v1/payload_builder.rb', line 7 def network @network end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
7 8 9 |
# File 'lib/x402/payments/v1/payload_builder.rb', line 7 def scheme @scheme end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
7 8 9 |
# File 'lib/x402/payments/v1/payload_builder.rb', line 7 def signature @signature end |
Class Method Details
.build(authorization:, signature:, scheme:, network:) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/x402/payments/v1/payload_builder.rb', line 36 def build(authorization:, signature:, scheme:, network:) new( authorization: , signature: signature, scheme: scheme, network: network ).build end |
Instance Method Details
#build ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/x402/payments/v1/payload_builder.rb', line 16 def build { x402Version: 1, scheme: scheme, network: network, payload: { signature: signature, authorization: { from: [:from], to: [:to], value: [:value], validAfter: [:valid_after], validBefore: [:valid_before], nonce: [:nonce] } } } end |