Class: GL::Registry::FeatureGroup
- Inherits:
-
FeatureProvider
- Object
- Token
- FeatureProvider
- GL::Registry::FeatureGroup
- Defined in:
- lib/opengl/registry/feature_group.rb
Overview
Describes a logical grouping of features for an OpenGL API.
Instance Attribute Summary collapse
-
#removals ⇒ Array<Feature>
readonly
An array of features that this instance removes.
-
#version ⇒ String
readonly
The OpenGL version this feature is associated with.
Attributes inherited from FeatureProvider
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(node) ⇒ FeatureGroup
constructor
Creates a new instance of the Feature class.
Methods inherited from Token
Constructor Details
#initialize(node) ⇒ FeatureGroup
Creates a new instance of the GL::Registry::Feature class.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/opengl/registry/feature_group.rb', line 20 def initialize(node) super(node) @version = node[Words::NUMBER] @removals = [] node.locate('remove').each do |child| api = child[Words::API]&.to_sym || @api profile = child[Words::PROFILE]&.to_sym child.nodes.each do |item| next unless item.is_a?(Ox::Element) @removals << Feature.new(item, api, profile) end end end |
Instance Attribute Details
#removals ⇒ Array<Feature> (readonly)
Returns an array of features that this instance removes.
14 15 16 |
# File 'lib/opengl/registry/feature_group.rb', line 14 def removals @removals end |
#version ⇒ String (readonly)
Returns the OpenGL version this feature is associated with.
10 11 12 |
# File 'lib/opengl/registry/feature_group.rb', line 10 def version @version end |