module Protip::Transformer

Interface for an object that converts between messages and more complex Ruby types. Resources and wrapped messages store one of these to transparently allow getting/setting of message fields as if they were Ruby types.

Public Instance Methods

to_message(object, field) click to toggle source
# File lib/protip/transformer.rb, line 10
def to_message(object, field)
  raise NotImplementedError.new('Must convert a Ruby object into a message of the given type')
end
to_object(message, field) click to toggle source
# File lib/protip/transformer.rb, line 6
def to_object(message, field)
  raise NotImplementedError.new('Must convert a message into a Ruby object')
end