Included Modules

Class/Module Index [+]

Quicksearch

RGen::MetamodelBuilder::BuilderRuntime

This module is mixed into MetamodelBuilder::MMBase. The methods provided by this module are used by the methods generated by the class methods of MetamodelBuilder::BuilderExtensions

Public Instance Methods

_assignmentTypeError(target, value, expected) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 55
def _assignmentTypeError(target, value, expected)
        text = ""
        if target
                targetId = target.class.name
                targetId += "(" + target.name + ")" if target.respond_to?(:name) and target.name
                text += "In #{targetId} : "
        end
        valueId = value.class.name
        valueId += "(" + value.name + ")" if value.respond_to?(:name) and value.name
        valueId += "(:" + value.to_s + ")" if value.is_a?(Symbol)
        text += "Can not use a #{valueId} where a #{expected} is expected"
        StandardError.new(text)
end
addGeneric(role, value, index=-1) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 21
def addGeneric(role, value, index=-1)
        send("add#{firstToUpper(role.to_s)}",value, index)
end
getGeneric(role) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 45
def getGeneric(role)
        send("get#{firstToUpper(role.to_s)}")
end
getGenericAsArray(role) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 49
def getGenericAsArray(role)
  result = getGeneric(role)
  result = [result].compact unless result.is_a?(Array)
  result
end
hasManyMethods(role) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 33
def hasManyMethods(role)
  respond_to?("add#{firstToUpper(role.to_s)}")
end
is_a?(c) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 16
    def is_a?(c)
return super unless c.const_defined?(:ClassModule)
kind_of?(c::ClassModule)
    end
removeGeneric(role, value) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 25
def removeGeneric(role, value)
        send("remove#{firstToUpper(role.to_s)}",value)
end
setGeneric(role, value) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 29
def setGeneric(role, value)
        send("set#{firstToUpper(role.to_s)}",value)
end
setOrAddGeneric(role, value) click to toggle source
# File lib/rgen/metamodel_builder/builder_runtime.rb, line 37
def setOrAddGeneric(role, value)
  if hasManyMethods(role)
    addGeneric(role, value)
  else
    setGeneric(role, value)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.