Class: WhyClasses::Options
- Inherits:
-
Data
- Object
- Data
- WhyClasses::Options
- Defined in:
- lib/why_classes/options.rb
Overview
Parsed CLI options (dogfooding the gem's own advice: a plain Data value).
mode: :report | :diff | :fix
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#cache_dir ⇒ Object
readonly
Returns the value of attribute cache_dir.
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
-
#except ⇒ Object
readonly
Returns the value of attribute except.
-
#fail_level ⇒ Object
readonly
Returns the value of attribute fail_level.
-
#fix_unsafe ⇒ Object
readonly
Returns the value of attribute fix_unsafe.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#only ⇒ Object
readonly
Returns the value of attribute only.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#rails ⇒ Object
readonly
Returns the value of attribute rails.
Class Method Summary collapse
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def cache @cache end |
#cache_dir ⇒ Object (readonly)
Returns the value of attribute cache_dir
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def cache_dir @cache_dir end |
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def config_path @config_path end |
#except ⇒ Object (readonly)
Returns the value of attribute except
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def except @except end |
#fail_level ⇒ Object (readonly)
Returns the value of attribute fail_level
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def fail_level @fail_level end |
#fix_unsafe ⇒ Object (readonly)
Returns the value of attribute fix_unsafe
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def fix_unsafe @fix_unsafe end |
#format ⇒ Object (readonly)
Returns the value of attribute format
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def format @format end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def mode @mode end |
#only ⇒ Object (readonly)
Returns the value of attribute only
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def only @only end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def paths @paths end |
#rails ⇒ Object (readonly)
Returns the value of attribute rails
7 8 9 |
# File 'lib/why_classes/options.rb', line 7 def rails @rails end |
Class Method Details
.defaults(**overrides) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/why_classes/options.rb', line 20 def self.defaults(**overrides) new(**{ paths: [], mode: :report, fix_unsafe: false, only: [], except: [], format: "progress", config_path: nil, rails: nil, fail_level: "convention", cache: false, cache_dir: ".why-classes-cache" }.merge(overrides)) end |