Class: Solana::Ruby::Kit::InstructionPlans::MessagePacker

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(done_proc:, pack_proc:) ⇒ MessagePacker

Returns a new instance of MessagePacker.



57
58
59
60
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 57

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

Returns:

  • (Boolean)


64
65
66
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 64

def done?
  @done_proc.call
end

#pack_message_to_capacity(message) ⇒ Object



72
73
74
# File 'lib/solana/ruby/kit/instruction_plans/instruction_plan.rb', line 72

def pack_message_to_capacity(message)
  @pack_proc.call(message)
end