Class: GoonModelGen::Golang::DatastorePackageFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/goon_model_gen/golang/datastore_package_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(package_alias_map) ⇒ DatastorePackageFactory

Returns a new instance of DatastorePackageFactory.



13
14
15
# File 'lib/goon_model_gen/golang/datastore_package_factory.rb', line 13

def initialize(package_alias_map)
  @package_alias_map = package_alias_map
end

Instance Attribute Details

#package_alias_mapObject (readonly)

Returns the value of attribute package_alias_map.



12
13
14
# File 'lib/goon_model_gen/golang/datastore_package_factory.rb', line 12

def package_alias_map
  @package_alias_map
end

Instance Method Details

#appengineObject



30
31
32
33
34
35
# File 'lib/goon_model_gen/golang/datastore_package_factory.rb', line 30

def appengine
  @appengine ||= Package.new(package_alias_map['appengine']).tap do |pkg|
    pkg.add(DatastoreSupported.new('BlobKey'))
    pkg.add(DatastoreSupported.new('GeoPoint'))
  end
end

#datastoreObject



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

def datastore
  @datastore ||= Package.new(package_alias_map['datastore']).tap do |pkg|
    pkg.add(DatastoreSupported.new('ByteString'))
    pkg.add(DatastoreSupported.new('Key'))
  end
end

#packagesObject



38
39
40
41
42
43
44
45
# File 'lib/goon_model_gen/golang/datastore_package_factory.rb', line 38

def packages
  @packages ||= Packages.new.tap do |pkgs|
    pkgs << Builtin.package
    pkgs << datastore
    pkgs << time
    pkgs << appengine
  end
end

#timeObject



24
25
26
27
28
# File 'lib/goon_model_gen/golang/datastore_package_factory.rb', line 24

def time
  @time ||= Package.new('time').tap do |pkg|
    pkg.add(DatastoreSupported.new('Time'))
  end
end