Class: GL::Registry::FeatureGroup

Inherits:
FeatureProvider show all
Defined in:
lib/opengl/registry/feature_group.rb

Overview

Describes a logical grouping of features for an OpenGL API.

Instance Attribute Summary collapse

Attributes inherited from FeatureProvider

#additions, #api, #name

Attributes inherited from Token

#comment

Instance Method Summary collapse

Methods inherited from Token

#to_s

Constructor Details

#initialize(node) ⇒ FeatureGroup

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

Parameters:

  • node (Ox::Element)

    The XML element defining the instance.



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

#removalsArray<Feature> (readonly)

Returns an array of features that this instance removes.

Returns:

  • (Array<Feature>)

    an array of features that this instance removes.



14
15
16
# File 'lib/opengl/registry/feature_group.rb', line 14

def removals
  @removals
end

#versionString (readonly)

Returns the OpenGL version this feature is associated with.

Returns:

  • (String)

    the OpenGL version this feature is associated with.



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

def version
  @version
end