Class: GL::Registry::Token Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/opengl/registry/token.rb

Overview

This class is abstract.

Base class for OpenGL registry defined items.

Direct Known Subclasses

Argument, Enum, Feature, FeatureProvider, Function, Group

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Token

Creates a new instance of the GL::Registry::Token class.

Parameters:

  • node (Ox::Element)

    The XML element defining the instance.

Raises:

  • (ArgumentError)


16
17
18
19
20
# File 'lib/opengl/registry/token.rb', line 16

def initialize(node)
  raise ArgumentError, 'item node cannot be nil' unless node

  @comment = node[Words::COMMENT]
end

Instance Attribute Details

#commentString? (readonly)

Returns an arbitrary comment associated with this object.

Returns:

  • (String?)

    an arbitrary comment associated with this object.



10
11
12
# File 'lib/opengl/registry/token.rb', line 10

def comment
  @comment
end

Instance Method Details

#to_sString

Returns the string representation of this object.

Returns:

  • (String)

    the string representation of this object.



24
25
26
# File 'lib/opengl/registry/token.rb', line 24

def to_s
  @name || super
end