Class: Glslkit::Diagnostic

Inherits:
Struct
  • Object
show all
Defined in:
lib/glslkit/diagnostic.rb

Overview

検証結果1件分(§8.2)。file/lineの解決はValidatorの役目であり、 DiagnosticやReflection自身は関与しない。

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def code
  @code
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def file
  @file
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def line
  @line
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def message
  @message
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def name
  @name
end

#programObject

Returns the value of attribute program

Returns:

  • (Object)

    the current value of program



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def program
  @program
end

#severityObject

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def severity
  @severity
end

#stageObject

Returns the value of attribute stage

Returns:

  • (Object)

    the current value of stage



6
7
8
# File 'lib/glslkit/diagnostic.rb', line 6

def stage
  @stage
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/glslkit/diagnostic.rb', line 7

def error?
  severity == :error
end

#to_sObject



15
16
17
# File 'lib/glslkit/diagnostic.rb', line 15

def to_s
  "[#{code}] #{location}: #{message}"
end

#warning?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/glslkit/diagnostic.rb', line 11

def warning?
  severity == :warning
end