Class: Diogenes::Validate::Issue

Inherits:
Struct
  • Object
show all
Defined in:
lib/diogenes/validate/issue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



6
7
8
# File 'lib/diogenes/validate/issue.rb', line 6

def file
  @file
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



6
7
8
# File 'lib/diogenes/validate/issue.rb', line 6

def message
  @message
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



6
7
8
# File 'lib/diogenes/validate/issue.rb', line 6

def severity
  @severity
end

Instance Method Details

#error?Boolean

: () -> bool

Returns:

  • (Boolean)


8
# File 'lib/diogenes/validate/issue.rb', line 8

def error? = severity == :error

#to_sObject

: () -> String



14
15
16
17
# File 'lib/diogenes/validate/issue.rb', line 14

def to_s
  tag = error? ? "ERROR" : " WARN"
  file ? "  #{tag}  #{file}#{message}" : "  #{tag}  #{message}"
end

#warning?Boolean

: () -> bool

Returns:

  • (Boolean)


11
# File 'lib/diogenes/validate/issue.rb', line 11

def warning? = severity == :warning