Class: Ruboclean::CliArguments
- Inherits:
-
Object
- Object
- Ruboclean::CliArguments
- Defined in:
- lib/ruboclean/cli_arguments.rb
Overview
Reads command line arguments and exposes corresponding reader methods
Instance Method Summary collapse
-
#initialize(command_line_arguments = []) ⇒ CliArguments
constructor
A new instance of CliArguments.
- #path ⇒ Object
- #preserve_comments? ⇒ Boolean
- #preserve_paths? ⇒ Boolean
- #silent? ⇒ Boolean
- #verbose? ⇒ Boolean
- #verify? ⇒ Boolean
Constructor Details
#initialize(command_line_arguments = []) ⇒ CliArguments
Returns a new instance of CliArguments.
6 7 8 |
# File 'lib/ruboclean/cli_arguments.rb', line 6 def initialize(command_line_arguments = []) @command_line_arguments = Array(command_line_arguments) end |
Instance Method Details
#path ⇒ Object
10 11 12 |
# File 'lib/ruboclean/cli_arguments.rb', line 10 def path @path ||= find_path end |
#preserve_comments? ⇒ Boolean
22 23 24 |
# File 'lib/ruboclean/cli_arguments.rb', line 22 def preserve_comments? @preserve_comments ||= find_argument("--preserve-comments") end |
#preserve_paths? ⇒ Boolean
26 27 28 |
# File 'lib/ruboclean/cli_arguments.rb', line 26 def preserve_paths? @preserve_paths ||= find_argument("--preserve-paths") end |
#silent? ⇒ Boolean
18 19 20 |
# File 'lib/ruboclean/cli_arguments.rb', line 18 def silent? @silent ||= find_argument("--silent") end |
#verbose? ⇒ Boolean
14 15 16 |
# File 'lib/ruboclean/cli_arguments.rb', line 14 def verbose? !silent? end |
#verify? ⇒ Boolean
30 31 32 |
# File 'lib/ruboclean/cli_arguments.rb', line 30 def verify? @verify ||= find_argument("--verify") end |