Class: Protobuf::Descriptor::DescriptorBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/protobuf/descriptor/descriptor_builder.rb

Class Method Summary collapse

Class Method Details

.acceptable_descriptor(proto) ⇒ Object



132
133
134
135
136
137
138
139
# File 'lib/protobuf/descriptor/descriptor_builder.rb', line 132

def acceptable_descriptor(proto)
  Protobuf::Descriptor.constants.each do |class_name|
    descriptor_class = Protobuf::Descriptor.const_get(class_name)
    if descriptor_class.respond_to?(:proto_type) && descriptor_class.proto_type == proto.class.name
      return descriptor_class
    end
  end
end

.build(proto, opt = {}) ⇒ Object



128
129
130
# File 'lib/protobuf/descriptor/descriptor_builder.rb', line 128

def build(proto, opt={})
  acceptable_descriptor(proto).build(proto)
end

.proto_typeObject



124
125
126
# File 'lib/protobuf/descriptor/descriptor_builder.rb', line 124

def proto_type
  nil
end