Sha256: 1890402489288aa3ca7804d7eb2fee93104d31e5c3411671f3a7e002037e0e13

Contents?: true

Size: 767 Bytes

Versions: 12

Compression:

Stored size: 767 Bytes

Contents

require "goon_model_gen"

module GoonModelGen
  module Golang
    class Type
      attr_reader :name
      attr_accessor :package

      # @param name [string]
      def initialize(name)
        @name = name
      end

      # @param pkgs [Packages]
      def resolve(pkgs)
        raise NotImplementedError, "#{self.type.name} doesn't implement resolve method"
      end

      # @param pkg2alias [Hash<String,String>]
      # @return [string]
      def qualified_name(pkg2alias = nil)
        if package && package.name
          pkg_name = (pkg2alias && package.path ? pkg2alias[package.path] : nil) || package.name
          "#{pkg_name}.#{name}"
        else
          name
        end
      end

      def memo
        @memo ||= {}
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
goon_model_gen-0.4.3 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.4.2 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.4.1 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.4.0 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.3.1 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.3.0 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.2.5 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.2.4 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.2.3 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.2.2 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.2.1 lib/goon_model_gen/golang/type.rb
goon_model_gen-0.2.0 lib/goon_model_gen/golang/type.rb