Class: RGen::ModelBuilder::ModelSerializer
- Inherits:
-
Object
- Object
- RGen::ModelBuilder::ModelSerializer
- Defined in:
- lib/rgen/model_builder/model_serializer.rb
Instance Method Summary collapse
-
#initialize(writable, rootPackage) ⇒ ModelSerializer
constructor
A new instance of ModelSerializer.
- #serialize(elements) ⇒ Object
Constructor Details
#initialize(writable, rootPackage) ⇒ ModelSerializer
Returns a new instance of ModelSerializer.
10 11 12 13 14 15 16 |
# File 'lib/rgen/model_builder/model_serializer.rb', line 10 def initialize(writable, rootPackage) @writable = writable @currentPackage = rootPackage @qualifiedElementName = {} @internalElementName = {} @relativeQualifiedElementName = {} end |
Instance Method Details
#serialize(elements) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/rgen/model_builder/model_serializer.rb', line 18 def serialize(elements) calcQualifiedElementNames(elements) unifyQualifiedElementNames elements = [elements] unless elements.is_a?(Enumerable) elements.each do |e| serializeElement(e) end end |