Class: GoonModelGen::Golang::DatastorePackageFactory
- Inherits:
-
Object
- Object
- GoonModelGen::Golang::DatastorePackageFactory
- Defined in:
- lib/goon_model_gen/golang/datastore_package_factory.rb
Instance Attribute Summary collapse
-
#package_alias_map ⇒ Object
readonly
Returns the value of attribute package_alias_map.
Instance Method Summary collapse
- #appengine ⇒ Object
- #datastore ⇒ Object
-
#initialize(package_alias_map) ⇒ DatastorePackageFactory
constructor
A new instance of DatastorePackageFactory.
- #packages ⇒ Object
- #time ⇒ Object
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_map ⇒ Object (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
#appengine ⇒ Object
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 |
#datastore ⇒ Object
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 |
#packages ⇒ Object
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 |
#time ⇒ Object
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 |