class Protobuf::Schema::Less

Defined in:

protobuf/schema/less.cr:2
protobuf/schema/less.cr:115

Constant Summary

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

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(buf : Buffer, option = nil) #

[View source]

Class Method Detail

def self.from_protobuf(io : IO | Bytes, option = nil) #

[View source]
def self.from_protobuf(bytes : String, option = nil) #

[View source]

Instance Method Detail

def [](key : Int) #

[View source]
def []?(key : Int) #

[View source]
def inspect(io : IO) #
Description copied from class Reference

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>

[View source]
def to_hash : Hash(UInt64, Array(Bool | Float32 | Float64 | Int32 | Int64 | Slice(UInt8) | String | UInt32 | UInt64 | Nil) | Bool | Float32 | Float64 | Int32 | Int64 | Slice(UInt8) | String | UInt32 | UInt64 | Nil) #

[View source]
def to_s(io : IO) #
Description copied from class Reference

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>

[View source]