Class: RubyCritic::Cli::Options
- Inherits:
-
Object
- Object
- RubyCritic::Cli::Options
- Defined in:
- lib/rubycritic/cli/options.rb,
lib/rubycritic/cli/options/argv.rb,
lib/rubycritic/cli/options/file.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#argv_options ⇒ Object
readonly
Returns the value of attribute argv_options.
-
#file_options ⇒ Object
readonly
Returns the value of attribute file_options.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Options
constructor
A new instance of Options.
- #parse ⇒ Object
-
#to_h ⇒ Object
:reek:NilCheck.
Constructor Details
Instance Attribute Details
#argv_options ⇒ Object (readonly)
Returns the value of attribute argv_options.
9 10 11 |
# File 'lib/rubycritic/cli/options.rb', line 9 def @argv_options end |
#file_options ⇒ Object (readonly)
Returns the value of attribute file_options.
9 10 11 |
# File 'lib/rubycritic/cli/options.rb', line 9 def @file_options end |
Instance Method Details
#parse ⇒ Object
16 17 18 19 20 |
# File 'lib/rubycritic/cli/options.rb', line 16 def parse .parse .parse self end |
#to_h ⇒ Object
:reek:NilCheck
23 24 25 26 27 28 29 30 |
# File 'lib/rubycritic/cli/options.rb', line 23 def to_h file_hash = .to_h argv_hash = .to_h file_hash.merge(argv_hash) do |_, file_option, argv_option| Array(argv_option).empty? ? file_option : argv_option end end |