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.
170 171 172 |
# File 'lib/protobug/compiler.rb', line 170 def file_to_generate @file_to_generate end |
Instance Method Details
#file_name ⇒ Object
156 157 158 159 160 161 162 163 164 |
# File 'lib/protobug/compiler.rb', line 156 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
166 167 168 |
# File 'lib/protobug/compiler.rb', line 166 def loc_by_path(path) source_code_info.location.find { |loc| loc.path == path } end |