Class: X402::Configuration::Route
- Inherits:
-
Struct
- Object
- Struct
- X402::Configuration::Route
- Defined in:
- lib/x402/configuration.rb
Overview
Route holds a raw +amount_sats+ that may be an Integer or a callable. The +resolve_amount_sats+ method evaluates callables at access time, enabling fiat-denominated pricing with live exchange rates.
Instance Attribute Summary collapse
-
#amount_sats ⇒ Object
Returns the value of attribute amount_sats.
-
#arc_wait_for ⇒ Object
Returns the value of attribute arc_wait_for.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#resolve_amount_sats ⇒ Object
Resolves +amount_sats+ — if it's a callable (Proc/Lambda), it is evaluated each time to get the current sats amount.
Instance Attribute Details
#amount_sats ⇒ Object
Returns the value of attribute amount_sats
19 20 21 |
# File 'lib/x402/configuration.rb', line 19 def amount_sats @amount_sats end |
#arc_wait_for ⇒ Object
Returns the value of attribute arc_wait_for
19 20 21 |
# File 'lib/x402/configuration.rb', line 19 def arc_wait_for @arc_wait_for end |
#http_method ⇒ Object
Returns the value of attribute http_method
19 20 21 |
# File 'lib/x402/configuration.rb', line 19 def http_method @http_method end |
#path ⇒ Object
Returns the value of attribute path
19 20 21 |
# File 'lib/x402/configuration.rb', line 19 def path @path end |
Instance Method Details
#resolve_amount_sats ⇒ Object
Resolves +amount_sats+ — if it's a callable (Proc/Lambda), it is evaluated each time to get the current sats amount.
22 23 24 |
# File 'lib/x402/configuration.rb', line 22 def resolve_amount_sats amount_sats.respond_to?(:call) ? amount_sats.call : amount_sats end |