Class: Schema::Value::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



1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/capnp/generator/schema.capnp.rb', line 1124

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