Class: Solace::Composers::Base
- Inherits:
-
Object
- Object
- Solace::Composers::Base
- Defined in:
- lib/solace/composers/base.rb
Overview
A Base class for all composers
Direct Known Subclasses
AssociatedTokenAccountProgramCreateAccountComposer, SplTokenProgramTransferCheckedComposer, SystemProgramTransferComposer
Instance Attribute Summary collapse
-
#account_context ⇒ Utils::AccountContext
The AccountContext instance for the composer.
-
#params ⇒ Hash
The parameters passed to the composer.
Instance Method Summary collapse
-
#build_instruction(indices) ⇒ void
Build instruction with resolved account indices.
-
#initialize(params) ⇒ Base
constructor
Initialize the composer.
-
#setup_accounts ⇒ void
Setup accounts required for this instruction.
Constructor Details
#initialize(params) ⇒ Base
Initialize the composer
24 25 26 27 28 |
# File 'lib/solace/composers/base.rb', line 24 def initialize(params) @params = params @account_context = Utils::AccountContext.new setup_accounts end |
Instance Attribute Details
#account_context ⇒ Utils::AccountContext
Returns The AccountContext instance for the composer.
19 20 21 |
# File 'lib/solace/composers/base.rb', line 19 def account_context @account_context end |
#params ⇒ Hash
Returns The parameters passed to the composer.
13 14 15 |
# File 'lib/solace/composers/base.rb', line 13 def params @params end |
Instance Method Details
#build_instruction(indices) ⇒ void
This method returns an undefined value.
Build instruction with resolved account indices
40 41 42 |
# File 'lib/solace/composers/base.rb', line 40 def build_instruction(indices) raise NotImplementedError, 'Subclasses must implement build_instruction method' end |
#setup_accounts ⇒ void
This method returns an undefined value.
Setup accounts required for this instruction
33 34 35 |
# File 'lib/solace/composers/base.rb', line 33 def setup_accounts raise NotImplementedError, 'Subclasses must implement setup_accounts method' end |