Class: Pal::Configuration::Config
- Inherits:
-
Object
- Object
- Pal::Configuration::Config
- Defined in:
- lib/pal/configuration.rb
Overview
Config data class - holds configuration settings.
Instance Attribute Summary collapse
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#source_file_loc ⇒ Object
Returns the value of attribute source_file_loc.
-
#template_file_loc ⇒ Object
Returns the value of attribute template_file_loc.
Instance Method Summary collapse
- #all_source_files ⇒ Object
-
#read_template_file ⇒ Object
Can probably remove this.
- #validate ⇒ Boolean
Instance Attribute Details
#output_dir ⇒ Object
Returns the value of attribute output_dir.
28 29 30 |
# File 'lib/pal/configuration.rb', line 28 def output_dir @output_dir end |
#source_file_loc ⇒ Object
Returns the value of attribute source_file_loc.
28 29 30 |
# File 'lib/pal/configuration.rb', line 28 def source_file_loc @source_file_loc end |
#template_file_loc ⇒ Object
Returns the value of attribute template_file_loc.
28 29 30 |
# File 'lib/pal/configuration.rb', line 28 def template_file_loc @template_file_loc end |
Instance Method Details
#all_source_files ⇒ Object
47 48 49 |
# File 'lib/pal/configuration.rb', line 47 def all_source_files @source_file_loc.split(",") end |
#read_template_file ⇒ Object
Can probably remove this
43 44 45 |
# File 'lib/pal/configuration.rb', line 43 def read_template_file JSON.parse(File.read(@template_file_loc)) end |
#validate ⇒ Boolean
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/pal/configuration.rb', line 31 def validate errors = decorate_errors if errors.size.positive? errors.each { |x| Pal.logger.info x } raise Pal::ValidationError.new(errors, "Invalid request.") end true end |