Class: GoaModelGen::GoStruct

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fieldsObject (readonly)

Returns the value of attribute fields.



8
9
10
# File 'lib/goa_model_gen/go_struct.rb', line 8

def fields
  @fields
end

#nameObject (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_pathObject (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

#sizeObject (readonly)

Returns the value of attribute size.



8
9
10
# File 'lib/goa_model_gen/go_struct.rb', line 8

def size
  @size
end