Class: RubyCritic::Cli::Options::File
- Inherits:
-
Object
- Object
- RubyCritic::Cli::Options::File
- Defined in:
- lib/rubycritic/cli/options/file.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(filename = './.rubycritic.yml') ⇒ File
constructor
A new instance of File.
- #parse ⇒ Object
-
#to_h ⇒ Object
rubocop:disable Metrics/MethodLength.
Constructor Details
#initialize(filename = './.rubycritic.yml') ⇒ File
Returns a new instance of File.
11 12 13 14 |
# File 'lib/rubycritic/cli/options/file.rb', line 11 def initialize(filename = './.rubycritic.yml') @filename = filename @options = {} end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
9 10 11 |
# File 'lib/rubycritic/cli/options/file.rb', line 9 def filename @filename end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/rubycritic/cli/options/file.rb', line 9 def @options end |
Instance Method Details
#parse ⇒ Object
16 17 18 |
# File 'lib/rubycritic/cli/options/file.rb', line 16 def parse @options = YAML.load_file(filename) if ::File.file?(filename) end |
#to_h ⇒ Object
rubocop:disable Metrics/MethodLength
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rubycritic/cli/options/file.rb', line 21 def to_h { mode: mode, root: root, formats: formats, deduplicate_symlinks: deduplicate_symlinks, paths: paths, suppress_ratings: , minimum_score: minimum_score, no_browser: no_browser, base_branch: base_branch, feature_branch: feature_branch, threshold_score: threshold_score } end |