Module: BOAST::Functors

Included in:
BOAST
Defined in:
lib/BOAST/Language/If.rb,
lib/BOAST/Language/For.rb,
lib/BOAST/Language/Case.rb,
lib/BOAST/Language/While.rb,
lib/BOAST/Language/Pragma.rb,
lib/BOAST/Language/Comment.rb,
lib/BOAST/Language/FuncCall.rb,
lib/BOAST/Language/FuncCall.rb,
lib/BOAST/Language/Functors.rb,
lib/BOAST/Language/Functors.rb,
lib/BOAST/Language/Variable.rb,
lib/BOAST/Language/Variable.rb,
lib/BOAST/Language/Variable.rb,
lib/BOAST/Language/CodeBlock.rb,
lib/BOAST/Language/Operators.rb,
lib/BOAST/Language/Procedure.rb,
lib/BOAST/Language/Expression.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.functorize(klass) ⇒ Object

Creates a wrapper for klass new method

Parameters:

  • klass (Class)

    class to turn into a functor.



28
29
30
31
32
33
34
35
36
# File 'lib/BOAST/Language/Functors.rb', line 28

def functorize(klass)
  name = klass.name.split('::').last
  s = <<EOF
  def #{name}(*args,&block)
    #{name}::new(*args,&block)
  end
EOF
  class_eval s
end

Instance Method Details

#AffectationObject

Creates a new Affectation object, arguments are passed to the new method of Affectation. (see Affectation#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize Affectation

#CodeBlockObject

Creates a new CodeBlock object, arguments are passed to the new method of CodeBlock. (see CodeBlock#initialize).



1
# File 'lib/BOAST/Language/CodeBlock.rb', line 1

functorize CodeBlock

#DimensionObject Also known as: Dim

Creates a new Dimension object, arguments are passed to the new method of Dimension. (see Dimension#initialize).



1
# File 'lib/BOAST/Language/Variable.rb', line 1

functorize Dimension

#ExpressionObject

Creates a new Expression object, arguments are passed to the new method of Expression. (see Expression#initialize).



1
# File 'lib/BOAST/Language/Expression.rb', line 1

functorize Expression

#FMAObject

Creates a new FMA object, arguments are passed to the new method of FMA. (see BOAST::FMA#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize FMA

#FMSObject

Creates a new FMS object, arguments are passed to the new method of FMS. (see BOAST::FMS#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize FMS

#LoadObject

Creates a new Load object, arguments are passed to the new method of Load. (see Load#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize Load

#MaskLoadObject

Creates a new MaskLoad object, arguments are passed to the new method of MaskLoad. (see MaskLoad#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize MaskLoad

#MaskStoreObject

Creates a new MaskStore object, arguments are passed to the new method of MaskStore. (see MaskStore#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize MaskStore

#ProcedureObject

Creates a new Procedure object, arguments are passed to the new method of Procedure. (see Procedure#initialize).



1
# File 'lib/BOAST/Language/Procedure.rb', line 1

functorize Procedure

#SetObject

Creates a new Set object, arguments are passed to the new method of Set. (see Set#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize Set

#StoreObject

Creates a new Store object, arguments are passed to the new method of Store. (see Store#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize Store

#TernaryObject

Creates a new Ternary object, arguments are passed to the new method of Ternary. (see Ternary#initialize).



1
# File 'lib/BOAST/Language/Operators.rb', line 1

functorize Ternary

#VariableObject Also known as: Var

Creates a new Variable object, arguments are passed to the new method of Variable. (see Variable#initialize).



1
# File 'lib/BOAST/Language/Variable.rb', line 1

functorize Variable