Class: Schema::Type::Which

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



838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
# File 'lib/capnp/generator/schema.capnp.rb', line 838

def self.from_integer(value)
  case value
  when 0 then Void
  when 1 then Bool
  when 2 then Int8
  when 3 then Int16
  when 4 then Int32
  when 5 then Int64
  when 6 then Uint8
  when 7 then Uint16
  when 8 then Uint32
  when 9 then Uint64
  when 10 then Float32
  when 11 then Float64
  when 12 then Text
  when 13 then Data
  when 14 then List
  when 15 then Enum
  when 16 then Struct
  when 17 then Interface
  when 18 then AnyPointer
  else raise "Unknown Which value: #{value}"
  end
end