Sha256: c8f22d862c95af89ac1a4f6e5d91c84d97279e2e727795e102b8089f78aae745

Contents?: true

Size: 583 Bytes

Versions: 2

Compression:

Stored size: 583 Bytes

Contents

class ProtobufDescriptor
  # A mixin module that adds tasty fully qualified name methods to objects that
  # have a name and a parent.
  module NamedChild
    def fully_qualified_name
      return "#{parent.fully_qualified_name}.#{self.name}"
    end

    def fully_qualified_java_name
      return "#{parent.fully_qualified_java_name}.#{self.name}"
    end

    def fully_qualified_wire_name
      return "#{parent.fully_qualified_wire_name}.#{self.name}"
    end

    def fully_qualified_ruby_name
      return "#{parent.fully_qualified_ruby_name}::#{self.name}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
protobuf_descriptor-1.0.0 lib/protobuf_descriptor/named_child.rb
protobuf_descriptor-0.1.0 lib/protobuf_descriptor/named_child.rb