Class: WGPU::CompilationMessage

Inherits:
Data
  • Object
show all
Defined in:
lib/wgpu/error.rb,
sig/wgpu.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



68
69
70
# File 'lib/wgpu/error.rb', line 68

def length
  @length
end

#line_numObject (readonly) Also known as: line

Returns the value of attribute line_num

Returns:

  • (Object)

    the current value of line_num



68
69
70
# File 'lib/wgpu/error.rb', line 68

def line_num
  @line_num
end

#line_posObject (readonly) Also known as: column

Returns the value of attribute line_pos

Returns:

  • (Object)

    the current value of line_pos



68
69
70
# File 'lib/wgpu/error.rb', line 68

def line_pos
  @line_pos
end

#messageObject (readonly)

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



68
69
70
# File 'lib/wgpu/error.rb', line 68

def message
  @message
end

#offsetObject (readonly)

Returns the value of attribute offset

Returns:

  • (Object)

    the current value of offset



68
69
70
# File 'lib/wgpu/error.rb', line 68

def offset
  @offset
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



68
69
70
# File 'lib/wgpu/error.rb', line 68

def type
  @type
end

Instance Method Details

#to_sString

Formats the diagnostic with source location, severity, and message.

Returns:

  • (String)


81
82
83
84
# File 'lib/wgpu/error.rb', line 81

def to_s
  location = line_num&.positive? ? "#{line_num}:#{line_pos}" : "unknown location"
  "#{location}: #{type}: #{message}"
end