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



214
215
216
217
# File 'lib/protobuf/message/field.rb', line 214

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

:nodoc:

Returns:

  • (Boolean)


219
220
221
# File 'lib/protobuf/message/field.rb', line 219

def ready? # :nodoc:
  false
end

#setupObject



223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/protobuf/message/field.rb', line 223

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