Class: Schema::Brand::Binding

Inherits:
Capnp::Struct show all
Defined in:
lib/capnp/generator/schema.capnp.rb

Defined Under Namespace

Classes: List, Which

Instance Method Summary collapse

Methods inherited from Capnp::Struct

decode_pointer, from_pointer, #initialize

Constructor Details

This class inherits a constructor from Capnp::Struct

Instance Method Details

#is_type?Boolean

Returns:

  • (Boolean)


951
# File 'lib/capnp/generator/schema.capnp.rb', line 951

def is_type? = which? == Which::Type

#is_unbound?Boolean

Returns:

  • (Boolean)


947
# File 'lib/capnp/generator/schema.capnp.rb', line 947

def is_unbound? = which? == Which::Unbound

#to_objObject



977
978
979
980
981
982
983
984
# File 'lib/capnp/generator/schema.capnp.rb', line 977

def to_obj
  res = {}
  case which?
  when Which::Unbound then res["unbound"] = unbound
  when Which::Type then res["type"] = type&.to_obj
  end
  res
end

#typeObject



949
# File 'lib/capnp/generator/schema.capnp.rb', line 949

def type = Schema::Type.from_pointer(read_pointer(0))

#unboundObject



945
# File 'lib/capnp/generator/schema.capnp.rb', line 945

def unbound = nil

#which?Boolean

Returns:

  • (Boolean)


959
# File 'lib/capnp/generator/schema.capnp.rb', line 959

def which? = Which.from_integer(read_u16(0, 0))