Class: X402::PaymentObserver::StaticRecogniser
- Inherits:
-
Object
- Object
- X402::PaymentObserver::StaticRecogniser
- Defined in:
- lib/x402/payment_observer.rb
Overview
Built-in recogniser for a single static payee address. Used when +payee_locking_script_hex+ is provided without a custom recogniser.
Instance Method Summary collapse
-
#initialize(payee_locking_script_hex) ⇒ StaticRecogniser
constructor
A new instance of StaticRecogniser.
-
#ours?(locking_script_hex) ⇒ Boolean
True if the script matches the configured payee.
Constructor Details
#initialize(payee_locking_script_hex) ⇒ StaticRecogniser
Returns a new instance of StaticRecogniser.
158 159 160 |
# File 'lib/x402/payment_observer.rb', line 158 def initialize(payee_locking_script_hex) @payee_hex = ::BSV::Script::Script.from_hex(payee_locking_script_hex).to_hex end |
Instance Method Details
#ours?(locking_script_hex) ⇒ Boolean
Returns true if the script matches the configured payee.
164 165 166 |
# File 'lib/x402/payment_observer.rb', line 164 def ours?(locking_script_hex) locking_script_hex == @payee_hex end |