Class: GoonModelGen::Golang::CombinationType::ItemType
- Inherits:
-
Object
- Object
- GoonModelGen::Golang::CombinationType::ItemType
- Defined in:
- lib/goon_model_gen/golang/combination_type.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#package_base_path ⇒ Object
readonly
Returns the value of attribute package_base_path.
-
#package_path ⇒ Object
readonly
Returns the value of attribute package_path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, package_path, package_base_path = nil) ⇒ ItemType
constructor
A new instance of ItemType.
- #resolve(pkgs) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(name, package_path, package_base_path = nil) ⇒ ItemType
Returns a new instance of ItemType.
11 12 13 |
# File 'lib/goon_model_gen/golang/combination_type.rb', line 11 def initialize(name, package_path, package_base_path = nil) @name, @package_path, @package_base_path = name, package_path, package_base_path end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/goon_model_gen/golang/combination_type.rb', line 9 def name @name end |
#package_base_path ⇒ Object (readonly)
Returns the value of attribute package_base_path.
9 10 11 |
# File 'lib/goon_model_gen/golang/combination_type.rb', line 9 def package_base_path @package_base_path end |
#package_path ⇒ Object (readonly)
Returns the value of attribute package_path.
9 10 11 |
# File 'lib/goon_model_gen/golang/combination_type.rb', line 9 def package_path @package_path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/goon_model_gen/golang/combination_type.rb', line 10 def type @type end |
Instance Method Details
#resolve(pkgs) ⇒ Object
20 21 22 |
# File 'lib/goon_model_gen/golang/combination_type.rb', line 20 def resolve(pkgs) @type = pkgs.type_by(**to_hash) || raise("Type not found by #{to_hash.inspect}") end |
#to_hash ⇒ Object
15 16 17 |
# File 'lib/goon_model_gen/golang/combination_type.rb', line 15 def to_hash {name: name, package_path: package_path, package_base_path: package_base_path} end |