Class: GoonModelGen::Golang::File

Inherits:
Object
  • Object
show all
Defined in:
lib/goon_model_gen/golang/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ File

Returns a new instance of File.

Parameters:

  • name (string)


14
15
16
17
# File 'lib/goon_model_gen/golang/file.rb', line 14

def initialize(name)
  @name = name
  @sentences = []
end

Instance Attribute Details

#custom_suffixObject

false/true



11
12
13
# File 'lib/goon_model_gen/golang/file.rb', line 11

def custom_suffix
  @custom_suffix
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/goon_model_gen/golang/file.rb', line 8

def name
  @name
end

#packageObject

Returns the value of attribute package.



10
11
12
# File 'lib/goon_model_gen/golang/file.rb', line 10

def package
  @package
end

#sentencesObject (readonly)

Returns the value of attribute sentences.



9
10
11
# File 'lib/goon_model_gen/golang/file.rb', line 9

def sentences
  @sentences
end

Instance Method Details

#new_sentence(template_path, type) ⇒ Object



19
20
21
22
23
# File 'lib/goon_model_gen/golang/file.rb', line 19

def new_sentence(template_path, type)
  Sentence.new(template_path, type).tap do |s|
    sentences.push(s)
  end
end