Module: Google::Protobuf::Internal::TypeSafety

Included in:
Descriptor, EnumDescriptor, FieldDescriptor, Arena, OneofDescriptor
Defined in:
lib/google/protobuf/ffi/internal/type_safety.rb

Instance Method Summary collapse

Instance Method Details

#to_native(value, ctx = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/google/protobuf/ffi/internal/type_safety.rb', line 14

def to_native(value, ctx = nil)
  if value.kind_of?(self) or value.nil?
    super
  else
    raise TypeError.new "Expected a kind of #{name}, was #{value.class}"
  end
end