Class: QuietQuality::Config::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/quiet_quality/config/options.rb

Constant Summary collapse

LOGGING_LEVELS =
[:quiet, :light, :normal].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptions

Returns a new instance of Options.



6
7
8
9
10
11
12
13
14
15
# File 'lib/quiet_quality/config/options.rb', line 6

def initialize
  @annotator = nil
  @executor = Executors::ConcurrentExecutor
  @tools = nil
  @exec_tool = nil
  @comparison_branch = nil
  @colorize = true
  @logging = :normal
  @message_format = nil
end

Instance Attribute Details

#annotatorObject

Returns the value of attribute annotator.



17
18
19
# File 'lib/quiet_quality/config/options.rb', line 17

def annotator
  @annotator
end

#colorize=(value) ⇒ Object (writeonly)

Sets the attribute colorize

Parameters:

  • value

    the value to set the attribute colorize to.



19
20
21
# File 'lib/quiet_quality/config/options.rb', line 19

def colorize=(value)
  @colorize = value
end

#comparison_branchObject

Returns the value of attribute comparison_branch.



17
18
19
# File 'lib/quiet_quality/config/options.rb', line 17

def comparison_branch
  @comparison_branch
end

#exec_toolObject

Returns the value of attribute exec_tool.



17
18
19
# File 'lib/quiet_quality/config/options.rb', line 17

def exec_tool
  @exec_tool
end

#executorObject

Returns the value of attribute executor.



17
18
19
# File 'lib/quiet_quality/config/options.rb', line 17

def executor
  @executor
end

#loggingObject

Returns the value of attribute logging.



18
19
20
# File 'lib/quiet_quality/config/options.rb', line 18

def logging
  @logging
end

#message_formatObject

Returns the value of attribute message_format.



17
18
19
# File 'lib/quiet_quality/config/options.rb', line 17

def message_format
  @message_format
end

#toolsObject

Returns the value of attribute tools.



17
18
19
# File 'lib/quiet_quality/config/options.rb', line 17

def tools
  @tools
end

Instance Method Details

#colorize?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/quiet_quality/config/options.rb', line 26

def colorize?
  !!@colorize
end

#light?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/quiet_quality/config/options.rb', line 34

def light?
  logging == :light
end

#quiet?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/quiet_quality/config/options.rb', line 30

def quiet?
  logging == :quiet
end

#to_hObject



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/quiet_quality/config/options.rb', line 38

def to_h
  {
    annotator: annotator,
    executor: executor.name,
    exec_tool: exec_tool,
    comparison_branch: comparison_branch,
    colorize: colorize?,
    logging: logging,
    message_format: message_format,
    tools: tool_hashes_by_name
  }
end