Class: Kobako::Snippet::Binary

Inherits:
Data
  • Object
show all
Defined in:
lib/kobako/snippet/binary.rb,
sig/kobako/snippet/binary.rbs

Overview

Kobako::Snippet::Binary — value object representing a single #preload(binary:) entry held by Kobako::Catalog::Snippets.

The body is RITE bytecode (as emitted by mrbc) carried as an ASCII_8BIT String so msgpack-ruby encodes it as bin family on the wire (docs/wire-codec.md Invocation channels). The host treats the bytes as opaque — the snippet's canonical name, when present, lives in the bytecode's embedded debug_info and is resolved by the guest at load time; structural validation is deferred to the first invocation's guest replay.

The class is a Data.define subclass — frozen and value-equal. Callers (chiefly Catalog::Snippets) construct instances via keyword form Binary.new(body: ...). Wire-form construction is the registry's responsibility.

Constant Summary collapse

KIND =

The kind field value carried by bytecode snippets in their Frame 3 wire envelope entry (docs/wire-codec.md Invocation channels).

Returns:

  • (String)
"bytecode"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bodyString (readonly)

Returns the value of attribute body.

Returns:

  • (String)


6
7
8
# File 'sig/kobako/snippet/binary.rbs', line 6

def body
  @body
end

Class Method Details

.new(body:) ⇒ Binary .new(body) ⇒ Binary

Overloads:

  • .new(body:) ⇒ Binary

    Parameters:

    • body: (String)

    Returns:

  • .new(body) ⇒ Binary

    Parameters:

    • body (String)

    Returns:



8
9
# File 'sig/kobako/snippet/binary.rbs', line 8

def self.new: (body: String) -> Binary
| (String body) -> Binary