Class: Archimate::FileFormats::Sax::ModelExchangeFile::PropertyDefinition

Inherits:
Handler
  • Object
show all
Includes:
CaptureDocumentation
Defined in:
lib/archimate/file_formats/sax/model_exchange_file/property_definition.rb

Instance Attribute Summary

Attributes inherited from Handler

#attrs, #element_type, #name, #parent_handler

Instance Method Summary collapse

Methods included from CaptureDocumentation

#documentation, #on_preserved_lang_string

Methods inherited from Handler

#characters, #diagram, #event, #method_missing, #process_text, #property_definitions, #respond_to_missing?

Constructor Details

#initialize(name, attrs, parent_handler) ⇒ PropertyDefinition

Returns a new instance of PropertyDefinition.



10
11
12
13
# File 'lib/archimate/file_formats/sax/model_exchange_file/property_definition.rb', line 10

def initialize(name, attrs, parent_handler)
  super
  @prop_def_name = @attrs["name"]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Archimate::FileFormats::Sax::Handler

Instance Method Details

#completeObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/archimate/file_formats/sax/model_exchange_file/property_definition.rb', line 15

def complete
  property_def = DataModel::PropertyDefinition.new(
    id: attrs["identifier"],
    name: @prop_def_name,
    documentation: documentation,
    type: attrs["type"]
  )
  [
    event(:on_property_definition, property_def),
    event(:on_referenceable, property_def)
  ]
end

#on_lang_string(name, _source) ⇒ Object



28
29
30
31
# File 'lib/archimate/file_formats/sax/model_exchange_file/property_definition.rb', line 28

def on_lang_string(name, _source)
  @prop_def_name = name
  false
end