Class: Protobug::Compiler::FileDescriptorProto
- Inherits:
-
Google::Protobuf::FileDescriptorProto
- Object
- Google::Protobuf::FileDescriptorProto
- Protobug::Compiler::FileDescriptorProto
- Includes:
- Descriptor
- Defined in:
- lib/protobug/compiler.rb
Instance Attribute Summary collapse
-
#file_to_generate ⇒ Object
Returns the value of attribute file_to_generate.
Attributes included from Descriptor
#descriptor, #file, #parent, #source_loc
Instance Method Summary collapse
Methods included from Descriptor
#full_name, included, #initialize, #to_constant
Instance Attribute Details
#file_to_generate ⇒ Object
Returns the value of attribute file_to_generate.
177 178 179 |
# File 'lib/protobug/compiler.rb', line 177 def file_to_generate @file_to_generate end |
Instance Method Details
#file_name ⇒ Object
163 164 165 166 167 168 169 170 171 |
# File 'lib/protobug/compiler.rb', line 163 def file_name ruby_package = .ruby_package if &.ruby_package? prefix = if ruby_package ruby_package.split("::").map!(&:downcase).join("/") else package.split(".").map!(&:downcase).join("/") end name.gsub(%r{^.*?([^/]+)\.proto$}, "#{prefix}/\\1_pb.rb") end |
#loc_by_path(path) ⇒ Object
173 174 175 |
# File 'lib/protobug/compiler.rb', line 173 def loc_by_path(path) source_code_info.location.find { |loc| loc.path == path } end |