Class: CTioga2::Graphics::Elements::TiogaPrimitiveCall::TiogaPrimitive

Inherits:
Object
  • Object
show all
Defined in:
lib/ctioga2/graphics/elements/primitive.rb

Overview

Some kind of reimplementation of Command for graphics primitives

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, comp, opts = {}, &code) ⇒ TiogaPrimitive

Creates a TiogaPrimitive object



58
59
60
61
62
63
# File 'lib/ctioga2/graphics/elements/primitive.rb', line 58

def initialize(name, comp, opts = {}, &code)
  @name = name
  @compulsory_arguments = comp
  @optional_arguments = opts
  @funcall = code
end

Instance Attribute Details

#compulsory_argumentsObject

An array of compulsory arguments (type specifications)



45
46
47
# File 'lib/ctioga2/graphics/elements/primitive.rb', line 45

def compulsory_arguments
  @compulsory_arguments
end

#funcallObject

A block that will receive a FigureMaker object, the compulsory arguments and a hash containing optional ones.



52
53
54
# File 'lib/ctioga2/graphics/elements/primitive.rb', line 52

def funcall
  @funcall
end

#nameObject

A name (not very useful, but, well, we never know)



42
43
44
# File 'lib/ctioga2/graphics/elements/primitive.rb', line 42

def name
  @name
end

#optional_argumentsObject

A hash of optional arguments



48
49
50
# File 'lib/ctioga2/graphics/elements/primitive.rb', line 48

def optional_arguments
  @optional_arguments
end

#primitive_classObject

The underlying nameless class



55
56
57
# File 'lib/ctioga2/graphics/elements/primitive.rb', line 55

def primitive_class
  @primitive_class
end