Class: GoaModelGen::GoStruct
- Inherits:
-
Object
- Object
- GoaModelGen::GoStruct
- Defined in:
- lib/goa_model_gen/go_struct.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pkg_path ⇒ Object
readonly
Returns the value of attribute pkg_path.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(d) ⇒ GoStruct
constructor
A new instance of GoStruct.
Constructor Details
#initialize(d) ⇒ GoStruct
Returns a new instance of GoStruct.
9 10 11 12 13 14 15 16 |
# File 'lib/goa_model_gen/go_struct.rb', line 9 def initialize(d) @name = d['Name'] @pkg_path = d['PkgPath'] @size = d['Size'] @fields = (d['Fields'] || []).map do |f| GoStructField.new(f) end end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
8 9 10 |
# File 'lib/goa_model_gen/go_struct.rb', line 8 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/goa_model_gen/go_struct.rb', line 8 def name @name end |
#pkg_path ⇒ Object (readonly)
Returns the value of attribute pkg_path.
8 9 10 |
# File 'lib/goa_model_gen/go_struct.rb', line 8 def pkg_path @pkg_path end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
8 9 10 |
# File 'lib/goa_model_gen/go_struct.rb', line 8 def size @size end |