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.
58 59 60 61 |
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 58 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
65 66 67 |
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 65 def done? @done_proc.call end |
#pack_message_to_capacity(message, max_instructions: nil) ⇒ Object
81 82 83 |
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 81 def (, max_instructions: nil) @pack_proc.call(, max_instructions) end |