Class: RailsCodeHealth::Configuration
- Inherits:
-
Object
- Object
- RailsCodeHealth::Configuration
- Defined in:
- lib/rails_code_health/configuration.rb
Instance Attribute Summary collapse
-
#excluded_paths ⇒ Object
Returns the value of attribute excluded_paths.
-
#output_format ⇒ Object
Returns the value of attribute output_format.
-
#thresholds ⇒ Object
Returns the value of attribute thresholds.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load_thresholds_from_file(file_path) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 |
# File 'lib/rails_code_health/configuration.rb', line 5 def initialize @thresholds = load_default_thresholds @excluded_paths = default_excluded_paths @output_format = :console end |
Instance Attribute Details
#excluded_paths ⇒ Object
Returns the value of attribute excluded_paths.
3 4 5 |
# File 'lib/rails_code_health/configuration.rb', line 3 def excluded_paths @excluded_paths end |
#output_format ⇒ Object
Returns the value of attribute output_format.
3 4 5 |
# File 'lib/rails_code_health/configuration.rb', line 3 def output_format @output_format end |
#thresholds ⇒ Object
Returns the value of attribute thresholds.
3 4 5 |
# File 'lib/rails_code_health/configuration.rb', line 3 def thresholds @thresholds end |
Instance Method Details
#load_thresholds_from_file(file_path) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/rails_code_health/configuration.rb', line 15 def load_thresholds_from_file(file_path) if File.exist?(file_path) @thresholds = JSON.parse(File.read(file_path)) else raise Error, "Thresholds file not found: #{file_path}" end end |