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



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

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)



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

def compulsory_arguments
  @compulsory_arguments
end

#funcallObject

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



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

def funcall
  @funcall
end

#nameObject

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



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

def name
  @name
end

#optional_argumentsObject

A hash of optional arguments



50
51
52
# File 'lib/ctioga2/graphics/elements/primitive.rb', line 50

def optional_arguments
  @optional_arguments
end