Class: GL::Registry::Token Abstract
- Inherits:
-
Object
- Object
- GL::Registry::Token
- Defined in:
- lib/opengl/registry/token.rb
Overview
This class is abstract.
Base class for OpenGL registry defined items.
Instance Attribute Summary collapse
-
#comment ⇒ String?
readonly
An arbitrary comment associated with this object.
Instance Method Summary collapse
-
#initialize(node) ⇒ Token
constructor
Creates a new instance of the Token class.
-
#to_s ⇒ String
The string representation of this object.
Constructor Details
#initialize(node) ⇒ Token
Creates a new instance of the GL::Registry::Token class.
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
#comment ⇒ String? (readonly)
Returns 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_s ⇒ String
Returns the string representation of this object.
24 25 26 |
# File 'lib/opengl/registry/token.rb', line 24 def to_s @name || super end |