Class: Schema::Field::GroupOrdinal

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

Defined Under Namespace

Classes: Which

Constant Summary collapse

DEFAULT_EXPLICIT =
0

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

#explicitObject



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

def explicit = read_u16(12, 0)

#implicitObject



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

def implicit = nil

#is_explicit?Boolean

Returns:

  • (Boolean)


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

def is_explicit? = which? == Which::Explicit

#is_implicit?Boolean

Returns:

  • (Boolean)


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

def is_implicit? = which? == Which::Implicit

#to_objObject



409
410
411
412
413
414
415
416
# File 'lib/capnp/generator/schema.capnp.rb', line 409

def to_obj
  res = {}
  case which?
  when Which::Implicit then res["implicit"] = implicit
  when Which::Explicit then res["explicit"] = explicit
  end
  res
end

#which?Boolean

Returns:

  • (Boolean)


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

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