Class: Schema::ElementSize

Inherits:
T::Enum
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/capnp/generator/schema.capnp.rb

Class Method Summary collapse

Class Method Details

.from_integer(value) ⇒ Object



1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
# File 'lib/capnp/generator/schema.capnp.rb', line 1214

def self.from_integer(value)
  case value
  when 0 then Empty
  when 1 then Bit
  when 2 then Byte
  when 3 then TwoBytes
  when 4 then FourBytes
  when 5 then EightBytes
  when 6 then Pointer
  when 7 then InlineComposite
  else raise "Unknown ElementSize value: #{value}"
  end
end