Class: Muwu::ProjectOptionsReader
- Inherits:
-
Object
- Object
- Muwu::ProjectOptionsReader
- Includes:
- Muwu
- Defined in:
- lib/muwu/project_options_builder/project_options_reader.rb
Constant Summary
Constants included from Muwu
GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION
Instance Attribute Summary collapse
-
#options_from_file ⇒ Object
Returns the value of attribute options_from_file.
-
#options_validated ⇒ Object
Returns the value of attribute options_validated.
-
#project_options ⇒ Object
Returns the value of attribute project_options.
Class Method Summary collapse
Instance Method Summary collapse
- #build_from_ymlfile(project) ⇒ Object
-
#initialize ⇒ ProjectOptionsReader
constructor
A new instance of ProjectOptionsReader.
- #phase_1_read_options_file ⇒ Object
- #phase_2_validate_options_file ⇒ Object
- #phase_3_set_project_options ⇒ Object
Methods included from Muwu
Constructor Details
#initialize ⇒ ProjectOptionsReader
Returns a new instance of ProjectOptionsReader.
25 26 27 28 29 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 25 def initialize @options_from_file = {} @options_validated = {} @project_options = ProjectOptions.new end |
Instance Attribute Details
#options_from_file ⇒ Object
Returns the value of attribute options_from_file.
11 12 13 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 11 def @options_from_file end |
#options_validated ⇒ Object
Returns the value of attribute options_validated.
11 12 13 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 11 def @options_validated end |
#project_options ⇒ Object
Returns the value of attribute project_options.
11 12 13 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 11 def @project_options end |
Class Method Details
.build {|builder| ... } ⇒ Object
18 19 20 21 22 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 18 def self.build builder = new yield(builder) builder. end |
Instance Method Details
#build_from_ymlfile(project) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 36 def build_from_ymlfile(project) @project = project end |
#phase_1_read_options_file ⇒ Object
44 45 46 47 48 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 44 def if ProjectValidator.new(@project). @options_from_file = YAML.load_file(@project.) end end |
#phase_2_validate_options_file ⇒ Object
51 52 53 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 51 def @options_validated = (@options_from_file) end |
#phase_3_set_project_options ⇒ Object
56 57 58 59 60 |
# File 'lib/muwu/project_options_builder/project_options_reader.rb', line 56 def @options_validated.each_pair do |key, value| @project_options.set_option(key, value) end end |