Class: Maximus::Statistic
- Inherits:
-
Object
- Object
- Maximus::Statistic
- Includes:
- Helper
- Defined in:
- lib/maximus/statistic.rb
Overview
Parent class for all statistics (inherited by children)
Direct Known Subclasses
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ void
constructor
Gather info about how the code performs.
Methods included from Helper
#check_default_config_path, #edit_yaml, #file_count, #file_list, #is_rails?, #lines_added_to_range, #node_module_exists, #path_exists?, #prompt, #reporter_path, #root_dir, #truthy?
Constructor Details
#initialize(opts = {}) ⇒ void
Gather info about how the code performs
All defined statistics require a “result” method
end
Inherits settings from Config#initialize
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/maximus/statistic.rb', line 31 def initialize(opts = {}) @config = opts[:config] || Maximus::Config.new(opts) @settings = @config.settings @path = opts[:file_paths] || @settings[:file_paths] @output = {} # This is different from lints # A new stat is run per file or URL, so they should be stored in a child # A lint just has one execution, so it's data can be stored directly in @output @output[:statistics] = {} end |
Instance Attribute Details
#output ⇒ Object
7 8 9 |
# File 'lib/maximus/statistic.rb', line 7 def output @output end |