Class: Solana::Ruby::Kit::InstructionPlans::MessagePacker
- Inherits:
-
Object
- Object
- Solana::Ruby::Kit::InstructionPlans::MessagePacker
- Extended by:
- T::Sig
- Defined in:
- lib/solana/ruby/kit/instruction_plans/instruction_plan.rb
Overview
Returned by MessagePackerInstructionPlan#get_message_packer. Mirrors the TypeScript MessagePacker interface.
Instance Method Summary collapse
- #done? ⇒ Boolean
-
#initialize(done_proc:, pack_proc:) ⇒ MessagePacker
constructor
A new instance of MessagePacker.
- #pack_message_to_capacity(message, max_instructions: nil) ⇒ Object
Constructor Details
#initialize(done_proc:, pack_proc:) ⇒ MessagePacker
Returns a new instance of MessagePacker.
70 71 72 73 |
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 70 def initialize(done_proc:, pack_proc:) @done_proc = T.let(done_proc, T.untyped) @pack_proc = T.let(pack_proc, T.untyped) end |
Instance Method Details
#done? ⇒ Boolean
77 78 79 |
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 77 def done? @done_proc.call end |
#pack_message_to_capacity(message, max_instructions: nil) ⇒ Object
93 94 95 |
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 93 def (, max_instructions: nil) @pack_proc.call(, max_instructions) end |