Module: BOAST::VarFunctors
- Included in:
- BOAST
- Defined in:
- lib/BOAST/Language/Functors.rb,
lib/BOAST/Language/Functors.rb,
lib/BOAST/Language/DataTypes.rb
Class Method Summary collapse
-
.var_functorize(klass) ⇒ Object
Creates a functor to create a Variable of type klass.
Instance Method Summary collapse
-
#CStruct(name, *args, &block) ⇒ Object
Creates a new Variable of type CStruct.
-
#CustomType(name, *args, &block) ⇒ Object
Creates a new Variable of type CustomType.
-
#Int(name, *args, &block) ⇒ Object
Creates a new Variable of type Int.
-
#Real(name, *args, &block) ⇒ Object
Creates a new Variable of type Real.
-
#Sizet(name, *args, &block) ⇒ Object
Creates a new Variable of type Sizet.
Class Method Details
.var_functorize(klass) ⇒ Object
Creates a functor to create a Variable of type klass
53 54 55 56 57 58 59 60 61 |
# File 'lib/BOAST/Language/Functors.rb', line 53 def var_functorize(klass) name = klass.name.split('::').last s = " def \#{name}(*args,&block)\n Variable::new(args[0],\#{name},*args[1..-1], &block)\n end\n" class_eval s end |
Instance Method Details
#CStruct(name, *args, &block) ⇒ Object
Creates a new Variable of type CStruct.
1 |
# File 'lib/BOAST/Language/DataTypes.rb', line 1 var_functorize CStruct |
#CustomType(name, *args, &block) ⇒ Object
Creates a new Variable of type CustomType.
1 |
# File 'lib/BOAST/Language/DataTypes.rb', line 1 var_functorize CustomType |
#Int(name, *args, &block) ⇒ Object
Creates a new Variable of type Int.
1 |
# File 'lib/BOAST/Language/DataTypes.rb', line 1 var_functorize Int |
#Real(name, *args, &block) ⇒ Object
Creates a new Variable of type Real.
1 |
# File 'lib/BOAST/Language/DataTypes.rb', line 1 var_functorize Real |
#Sizet(name, *args, &block) ⇒ Object
Creates a new Variable of type Sizet.
1 |
# File 'lib/BOAST/Language/DataTypes.rb', line 1 var_functorize Sizet |