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

Instance Method Summary collapse

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 = <<EOF
  def #{name}(*args,&block)
    Variable::new(args[0],#{name},*args[1..-1], &block)
  end
EOF
  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