Class: Protobuf::Generators::OptionGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/protobuf/generators/option_generator.rb

Constant Summary

Constants included from Printable

Printable::PARENT_CLASS_ENUM, Printable::PARENT_CLASS_MESSAGE, Printable::PARENT_CLASS_SERVICE

Instance Attribute Summary

Attributes inherited from Base

#descriptor, #namespace, #options

Instance Method Summary collapse

Methods inherited from Base

#fully_qualified_type_namespace, #initialize, #run_once, #serialize_value, #to_s, #type_namespace, validate_tags

Methods included from Printable

#init_printer

Constructor Details

This class inherits a constructor from Protobuf::Generators::Base

Instance Method Details

#compileObject



6
7
8
9
10
11
12
13
14
# File 'lib/protobuf/generators/option_generator.rb', line 6

def compile
  run_once(:compile) do
    descriptor.each_field.map do |field, value|
      next unless descriptor.field?(field.name)
      serialized_value = serialize_value(value)
      puts "set_option #{field.fully_qualified_name.inspect}, #{serialized_value}"
    end
  end
end