Class: VivlioStarter::CLI::Guards::Violation

Inherits:
Data
  • Object
show all
Defined in:
lib/vivlio_starter/cli/guards/base_check.rb

Overview

単一の前提条件違反。 detail は Common.log_error / log_warn の detail: に渡され、 2行目以降としてインデント表示される(logging_spec.md 準拠)。

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailObject (readonly)

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



10
11
12
# File 'lib/vivlio_starter/cli/guards/base_check.rb', line 10

def detail
  @detail
end

#messageObject (readonly)

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



10
11
12
# File 'lib/vivlio_starter/cli/guards/base_check.rb', line 10

def message
  @message
end

#severityObject (readonly)

:error(停止)または :warn(警告のみ)



10
11
12
13
# File 'lib/vivlio_starter/cli/guards/base_check.rb', line 10

Violation = Data.define(:severity, :message, :detail) do
  def error? = severity == :error
  def warn?  = severity == :warn
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


11
# File 'lib/vivlio_starter/cli/guards/base_check.rb', line 11

def error? = severity == :error

#warn?Boolean

Returns:

  • (Boolean)


12
# File 'lib/vivlio_starter/cli/guards/base_check.rb', line 12

def warn?  = severity == :warn