Class RGen::Environment
In: lib/rgen/environment.rb
Parent: Object

An Environment is used to hold model elements.

Methods

<<   delete   each   elements   find   new   new  

Public Class methods

Public Instance methods

Add a model element. Returns the environment so << can be chained.

Removes model element from environment.

Iterates each element

Return the elements of the environment as an array

Finds and returns model elements in the environment.

The search description argument must be a hash specifying attribute/value pairs. Only model elements are returned which respond to the specified attribute methods and return the specified values as result of these attribute methods.

As a special hash key :class can be used to look for model elements of a specific class. In this case an array of possible classes can optionally be given.

This method can be used to instantiate a class and automatically put it into the environment. The new instance is returned.

[Validate]