Class: QuietQuality::Config::ToolOptions
- Inherits:
-
Object
- Object
- QuietQuality::Config::ToolOptions
- Defined in:
- lib/quiet_quality/config/tool_options.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#exec_command ⇒ Object
Returns the value of attribute exec_command.
-
#file_filter ⇒ Object
Returns the value of attribute file_filter.
-
#filter_messages ⇒ Object
writeonly
Sets the attribute filter_messages.
-
#limit_targets ⇒ Object
writeonly
Sets the attribute limit_targets.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
Instance Method Summary collapse
- #filter_messages? ⇒ Boolean
-
#initialize(tool, **options) ⇒ ToolOptions
constructor
A new instance of ToolOptions.
- #limit_targets? ⇒ Boolean
- #parser_class ⇒ Object
- #runner_class ⇒ Object
- #to_h ⇒ Object
- #tool_namespace ⇒ Object
Constructor Details
#initialize(tool, **options) ⇒ ToolOptions
Returns a new instance of ToolOptions.
4 5 6 7 8 9 10 11 |
# File 'lib/quiet_quality/config/tool_options.rb', line 4 def initialize(tool, **) @tool_name = tool.to_sym @limit_targets = .fetch(:limit_targets, true) @filter_messages = .fetch(:filter_messages, true) @file_filter = .fetch(:file_filter, nil) @command = .fetch(:command, nil) @exec_command = .fetch(:exec_command, nil) end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
13 14 15 |
# File 'lib/quiet_quality/config/tool_options.rb', line 13 def command @command end |
#exec_command ⇒ Object
Returns the value of attribute exec_command.
13 14 15 |
# File 'lib/quiet_quality/config/tool_options.rb', line 13 def exec_command @exec_command end |
#file_filter ⇒ Object
Returns the value of attribute file_filter.
13 14 15 |
# File 'lib/quiet_quality/config/tool_options.rb', line 13 def file_filter @file_filter end |
#filter_messages=(value) ⇒ Object (writeonly)
Sets the attribute filter_messages
15 16 17 |
# File 'lib/quiet_quality/config/tool_options.rb', line 15 def (value) @filter_messages = value end |
#limit_targets=(value) ⇒ Object (writeonly)
Sets the attribute limit_targets
15 16 17 |
# File 'lib/quiet_quality/config/tool_options.rb', line 15 def limit_targets=(value) @limit_targets = value end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
14 15 16 |
# File 'lib/quiet_quality/config/tool_options.rb', line 14 def tool_name @tool_name end |
Instance Method Details
#filter_messages? ⇒ Boolean
21 22 23 |
# File 'lib/quiet_quality/config/tool_options.rb', line 21 def @filter_messages end |
#limit_targets? ⇒ Boolean
17 18 19 |
# File 'lib/quiet_quality/config/tool_options.rb', line 17 def limit_targets? @limit_targets end |
#parser_class ⇒ Object
33 34 35 |
# File 'lib/quiet_quality/config/tool_options.rb', line 33 def parser_class tool_namespace::Parser end |
#runner_class ⇒ Object
29 30 31 |
# File 'lib/quiet_quality/config/tool_options.rb', line 29 def runner_class tool_namespace::Runner end |
#to_h ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/quiet_quality/config/tool_options.rb', line 37 def to_h { tool_name: tool_name, limit_targets: limit_targets?, filter_messages: , file_filter: file_filter&.regex&.to_s, command: command, exec_command: exec_command, excludes: file_filter&.excludes&.map(&:to_s) } end |