407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
# File 'lib/cel/ast/elements/protobuf.rb', line 407
def ==(other)
super || begin
return false unless other.is_a?(Protobuf.base_class)
a1 = self
a2 = other
if a1.is_a?(Google::Protobuf::Any) && !a1.type_url.empty?
a1 = a1.unpack(Object.const_get(Cel.package_to_module_name(a1.type_name)))
a1.extend(CelComparisonMode)
end
if a2.is_a?(Google::Protobuf::Any) && !a2.type_url.empty?
a2 = a2.unpack(Object.const_get(Cel.package_to_module_name(a2.type_name)))
end
return false unless a1.class == a2.class
if a1.is_a?(Google::Protobuf::Any) && a1.type_url.empty?
a2.is_a?(Google::Protobuf::Any) && a2.type_url.empty?
return a1.value == a2.value
end
a1.class.descriptor.each do |field|
f1 = a1.public_send(field.name)
f1.extend(CelComparisonMode) if f1.is_a?(Protobuf.base_class)
f2 = a2.public_send(field.name)
return false unless f1 == f2
end
true
end
end
|