Class: Pal::Configuration::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/pal/configuration.rb

Overview

Config data class - holds configuration settings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#output_dirObject

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_locObject

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_locObject

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_filesObject



47
48
49
# File 'lib/pal/configuration.rb', line 47

def all_source_files
  @source_file_loc.split(",")
end

#read_template_fileObject

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

#validateBoolean

Returns:

  • (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