Class: RGen::MetamodelBuilder::MMBase
- Inherits:
-
Object
- Object
- RGen::MetamodelBuilder::MMBase
- Extended by:
- ECore::ECoreInterface, BuilderExtensions, ModuleExtension
- Includes:
- BuilderRuntime, DataTypes
- Defined in:
- lib/rgen/metamodel_builder.rb
Overview
Use this class as a start for new metamodel elements (i.e. Ruby classes) by inheriting for it.
See MetamodelBuilder for an example.
Direct Known Subclasses
ECore::EModelElement, ECore::EObject, ECore::EStringToStringMapEntry, UML13::ActionInstance, UML13::Call, UML13::Element, UML13::ElementImport, UML13::ElementResidence, UML13::EnumerationLiteral, UML13::Expression, UML13::Multiplicity, UML13::MultiplicityRange, UML13::TemplateParameter, UML13EA::ActionInstance, UML13EA::Call, UML13EA::Element, UML13EA::ElementImport, UML13EA::ElementResidence, UML13EA::EnumerationLiteral, UML13EA::Expression, UML13EA::Multiplicity, UML13EA::MultiplicityRange, UML13EA::TemplateParameter, UML13EA::XmiIdProvider
Constant Summary
Constants included from DataTypes
DataTypes::Boolean, DataTypes::Long
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(arg = nil) ⇒ MMBase
constructor
A new instance of MMBase.
-
#inspect ⇒ Object
Object#inspect causes problems on most models.
Methods included from BuilderExtensions
_abstract_class, _add_metamodel_description, _metamodel_description, abstract, contains_many, contains_many_uni, contains_one, contains_one_uni, has_attr, has_many, has_many_attr, has_one, inherited, many_to_many, many_to_one, one_to_many, one_to_one
Methods included from Util::NameHelper
#camelize, #className, #firstToLower, #firstToUpper, #normalize, #saneClassName, #saneMethodName
Methods included from ModuleExtension
_annotations, _constantOrder, annotation, extended, final_method, method_added
Methods included from ECore::ECoreInterface
_set_ecore_internal, clear_ecore_cache, ecore
Methods included from BuilderRuntime
#_add_contained_element, #_assignmentTypeError, #_remove_contained_element, #_set_container, #addGeneric, #disconnectContainer, #eAllContents, #eContainer, #eContainingFeature, #eContents, #eIsSet, #eUnset, #getGenericAsArray, #hasManyMethods, #is_a?, #removeGeneric, #setGeneric, #setNilOrRemoveAllGeneric, #setNilOrRemoveGeneric, #setOrAddGeneric
Constructor Details
#initialize(arg = nil) ⇒ MMBase
Returns a new instance of MMBase.
187 188 189 190 |
# File 'lib/rgen/metamodel_builder.rb', line 187 def initialize(arg=nil) raise StandardError.new("Class #{self.class} is abstract") if self.class._abstract_class arg.each_pair { |k,v| setGeneric(k, v) } if arg.is_a?(Hash) end |
Class Method Details
.method_added(m) ⇒ Object
197 198 199 |
# File 'lib/rgen/metamodel_builder.rb', line 197 def self.method_added(m) raise "Do not add methods to model classes directly, add them to the ClassModule instead" end |
Instance Method Details
#inspect ⇒ Object
Object#inspect causes problems on most models
193 194 195 |
# File 'lib/rgen/metamodel_builder.rb', line 193 def inspect self.class.name end |