Protobuf::Schema::Less
Inherits Reference < Object
Constants
DEFAULT_READERS = {0 => "uint64", 1 => "double", 2 => "string", 5 => "float"}
TYPED_READERS = {"int32" => ->(buf : Buffer) do
buf.read_int32
end, "int64" => ->(buf : Buffer) do
buf.read_int64
end, "uint32" => ->(buf : Buffer) do
buf.read_uint32
end, "uint64" => ->(buf : Buffer) do
buf.read_uint64
end, "sint32" => ->(buf : Buffer) do
buf.read_sint32
end, "sint64" => ->(buf : Buffer) do
buf.read_sint64
end, "bool" => ->(buf : Buffer) do
buf.read_bool
end, "fixed64" => ->(buf : Buffer) do
buf.read_fixed64
end, "sfixed64" => ->(buf : Buffer) do
buf.read_sfixed64
end, "double" => ->(buf : Buffer) do
buf.read_double
end, "string" => ->(buf : Buffer) do
buf.read_string
end, "bytes" => ->(buf : Buffer) do
buf.read_bytes
end, "fixed32" => ->(buf : Buffer) do
buf.read_fixed32
end, "sfixed32" => ->(buf : Buffer) do
buf.read_sfixed32
end, "float" => ->(buf : Buffer) do
buf.read_float
end}
Constructors
new(buf : Buffer, option = nil)
SourceClass methods
from_protobuf(io : IO | Bytes, option = nil)
Sourcefrom_protobuf(bytes : String, option = nil)
SourceInstance methods
[](key : Int)
Source[]?(key : Int)
Sourceinspect(io : IO)
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
to_hash
Sourceto_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>