Class: Defgen::DefaultfileBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/defgen/defaultfile_builder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#defaultfileObject

Returns the value of attribute defaultfile.



3
4
5
# File 'lib/defgen/defaultfile_builder.rb', line 3

def defaultfile
  @defaultfile
end

#parserObject

Returns the value of attribute parser.



3
4
5
# File 'lib/defgen/defaultfile_builder.rb', line 3

def parser
  @parser
end

#project_settingsObject

Returns the value of attribute project_settings.



3
4
5
# File 'lib/defgen/defaultfile_builder.rb', line 3

def project_settings
  @project_settings
end

Class Method Details

.buildObject



5
6
7
# File 'lib/defgen/defaultfile_builder.rb', line 5

def self.build
  new.tap { |instance| yield(instance) }.build
end

Instance Method Details

#buildObject



9
10
11
12
# File 'lib/defgen/defaultfile_builder.rb', line 9

def build
  properties = parser.parse(defaultfile).each do |property| property.prefix = project_settings.prefix end
  Defaultfile.new properties, project_settings
end