Module: Cel::Protobuf::ContextExtensions

Included in:
Context
Defined in:
lib/cel/protobuf.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



158
159
160
161
162
# File 'lib/cel/protobuf.rb', line 158

def self.included(klass)
  super
  klass.alias_method :to_cel_type_without_protobuf, :to_cel_type
  klass.alias_method :to_cel_type, :to_cel_type_with_protobuf
end

Instance Method Details

#to_cel_type_with_protobuf(v) ⇒ Object



164
165
166
167
168
# File 'lib/cel/protobuf.rb', line 164

def to_cel_type_with_protobuf(v)
  return v if v.is_a?(Google::Protobuf::MessageExts)

  to_cel_type_without_protobuf(v)
end