Class: GoaModelGen::GoStruct

Inherits:
Object
  • Object
show all
Includes:
GoPackage
Defined in:
lib/goa_model_gen/go_struct.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GoPackage

#package, #package_path_name

Constructor Details

#initialize(d) ⇒ GoStruct

Returns a new instance of GoStruct.



13
14
15
16
17
18
19
20
# File 'lib/goa_model_gen/go_struct.rb', line 13

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

#fieldsObject (readonly)

Returns the value of attribute fields.



12
13
14
# File 'lib/goa_model_gen/go_struct.rb', line 12

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/goa_model_gen/go_struct.rb', line 12

def name
  @name
end

#pkg_pathObject (readonly)

Returns the value of attribute pkg_path.



12
13
14
# File 'lib/goa_model_gen/go_struct.rb', line 12

def pkg_path
  @pkg_path
end

#sizeObject (readonly)

Returns the value of attribute size.



12
13
14
# File 'lib/goa_model_gen/go_struct.rb', line 12

def size
  @size
end