Class: Protobuf::Field::FieldProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/protobuf/message/field.rb

Instance Method Summary collapse

Constructor Details

#initialize(message_class, rule, type, name, tag, options) ⇒ FieldProxy

Returns a new instance of FieldProxy.



238
239
240
241
# File 'lib/protobuf/message/field.rb', line 238

def initialize(message_class, rule, type, name, tag, options)
  @message_class, @rule, @type, @name, @tag, @options =
    message_class, rule, type, name, tag, options
end

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


243
244
245
# File 'lib/protobuf/message/field.rb', line 243

def ready?
  false
end

#setupObject



247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/protobuf/message/field.rb', line 247

def setup
  type = typename_to_class(@message_class, @type)
  field_class = \
    if type < Enum
      EnumField
    elsif type < Message
      MessageField
    else
      raise TypeError, type.inspect
    end
  field_class.new(@message_class, @rule, type, @name, @tag, @options)
end