Class: GoonModelGen::Golang::Builtin

Inherits:
PredeclaredType show all
Defined in:
lib/goon_model_gen/golang/builtin.rb

Constant Summary collapse

TYPE_NAMES =
%w[bool byte complex128 complex64
error float32 float64 int int16 int32 int64 int8
rune string uint uint16 uint32 uint64 uint8 uintptr
interface]

Instance Attribute Summary

Attributes inherited from Type

#name, #package

Class Method Summary collapse

Methods inherited from PredeclaredType

#resolve

Methods inherited from Type

#initialize, #memo, #qualified_name, #resolve

Constructor Details

This class inherits a constructor from GoonModelGen::Golang::Type

Class Method Details

.instancesObject



25
26
27
# File 'lib/goon_model_gen/golang/builtin.rb', line 25

def instances
  @instances ||= TYPE_NAMES.map{|name| self.new(name) }
end

.packageObject



16
17
18
19
20
21
22
23
# File 'lib/goon_model_gen/golang/builtin.rb', line 16

def package
  @package ||= Package.new(nil).tap do |pkg|
    instances.each do |i|
      i.package = pkg
      pkg.types.push(i)
    end
  end
end