Class: GL::Registry::Function
- Defined in:
- lib/opengl/registry/function.rb
Overview
Describes an OpenGL function.
Instance Attribute Summary collapse
-
#alias_name ⇒ String?
readonly
An alternative name associated with this function.
-
#arguments ⇒ Array<Argument>
readonly
An array of arguments for this function.
-
#name ⇒ String
readonly
The name of the function.
-
#type ⇒ NativeType
readonly
The return type of function.
-
#vec_equiv ⇒ String?
readonly
A "vector equivalent" version of this function that does not use separate parameters.
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(node) ⇒ Function
constructor
Creates a new instance of the Function class.
Methods inherited from Token
Constructor Details
#initialize(node) ⇒ Function
Creates a new instance of the GL::Registry::Function class.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/opengl/registry/function.rb', line 32 def initialize(node) super(node) @arguments = [] node.nodes.each do |child| case child.name when Words::PROTO parse_prototype(child) when Words::PARAM @arguments << Argument.new(child) when Words::ALIAS @alias_name = child[Words::NAME] when Words::VECTOR_EQUIVALENT @vec_equiv = child[Words::NAME] else next end end end |
Instance Attribute Details
#alias_name ⇒ String? (readonly)
Returns an alternative name associated with this function.
22 23 24 |
# File 'lib/opengl/registry/function.rb', line 22 def alias_name @alias_name end |
#arguments ⇒ Array<Argument> (readonly)
Returns an array of arguments for this function.
18 19 20 |
# File 'lib/opengl/registry/function.rb', line 18 def arguments @arguments end |
#name ⇒ String (readonly)
Returns the name of the function.
10 11 12 |
# File 'lib/opengl/registry/function.rb', line 10 def name @name end |
#type ⇒ NativeType (readonly)
Returns the return type of function.
14 15 16 |
# File 'lib/opengl/registry/function.rb', line 14 def type @type end |
#vec_equiv ⇒ String? (readonly)
Returns a "vector equivalent" version of this function that does not use separate parameters.
26 27 28 |
# File 'lib/opengl/registry/function.rb', line 26 def vec_equiv @vec_equiv end |