Class: GL::Registry::Feature
- Defined in:
- lib/opengl/registry/feature.rb
Overview
Note:
This is a reference for the item only, and is only used to look up the corresponding item's definition.
Describes a single definition of a item to add/remove from an OpenGL API.
Instance Attribute Summary collapse
-
#api ⇒ Symbol
readonly
The OpenGL API this item is associated with.
-
#name ⇒ String
readonly
The name of the entity.
-
#profile ⇒ Symbol
readonly
The OpenGL profile this item is associated with.
-
#type ⇒ :enum, ...
readonly
A symbol specifying the feature type.
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(node, api, profile) ⇒ Feature
constructor
Creates a new instance of the Feature class.
Methods inherited from Token
Constructor Details
#initialize(node, api, profile) ⇒ Feature
Creates a new instance of the GL::Registry::Feature class.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/opengl/registry/feature.rb', line 32 def initialize(node, api, profile) super(node) @name = node[Words::NAME] @api = api || :none @profile = profile || :none @type = case node.name when Words::ENUM then :enum when Words::COMMAND then :function when Words::TYPE then :type else :unknown end end |
Instance Attribute Details
#api ⇒ Symbol (readonly)
Returns the OpenGL API this item is associated with.
16 17 18 |
# File 'lib/opengl/registry/feature.rb', line 16 def api @api end |
#name ⇒ String (readonly)
Returns the name of the entity.
12 13 14 |
# File 'lib/opengl/registry/feature.rb', line 12 def name @name end |
#profile ⇒ Symbol (readonly)
Returns the OpenGL profile this item is associated with.
20 21 22 |
# File 'lib/opengl/registry/feature.rb', line 20 def profile @profile end |
#type ⇒ :enum, ... (readonly)
Returns a symbol specifying the feature type.
24 25 26 |
# File 'lib/opengl/registry/feature.rb', line 24 def type @type end |