Class: Archimate::FileFormats::Sax::ModelExchangeFile::ViewNode

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

Instance Attribute Summary

Attributes inherited from Handler

#attrs, #element_type, #name, #parent_handler

Instance Method Summary collapse

Methods included from CaptureProperties

#on_property, #properties

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) ⇒ ViewNode

Returns a new instance of ViewNode.



11
12
13
14
15
16
17
18
19
20
# File 'lib/archimate/file_formats/sax/model_exchange_file/view_node.rb', line 11

def initialize(name, attrs, parent_handler)
  super
  @view_nodes = []
  @connections = []
  @content = nil
  @view_node_name = nil
  @style = nil
  @view_node = nil
  @bounds = nil
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



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/archimate/file_formats/sax/model_exchange_file/view_node.rb', line 22

def complete
  [
    event(:on_future,
          # Fiber.new { |index| view_node.view_refs = index[attrs["model"]] },
          Sax::FutureReference.new(view_node, :view_refs, attrs["model"])),
    event(:on_future,
          Sax::FutureReference.new(view_node,
                                   :element,
                                   attrs["elementRef"] || attrs["elementref"])),
    event(:on_referenceable, view_node),
    event(:on_view_node, view_node)
  ]
end

#on_connection(connection, source) ⇒ Object



46
47
48
49
# File 'lib/archimate/file_formats/sax/model_exchange_file/view_node.rb', line 46

def on_connection(connection, source)
  @connections << connection if source.parent_handler == self
  connection
end

#on_content(string, _source) ⇒ Object



51
52
53
# File 'lib/archimate/file_formats/sax/model_exchange_file/view_node.rb', line 51

def on_content(string, _source)
  @content = string
end

#on_lang_string(name, _source) ⇒ Object



36
37
38
39
# File 'lib/archimate/file_formats/sax/model_exchange_file/view_node.rb', line 36

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

#on_style(style, _source) ⇒ Object



55
56
57
58
# File 'lib/archimate/file_formats/sax/model_exchange_file/view_node.rb', line 55

def on_style(style, _source)
  @style = style
  false
end

#on_view_node(view_node, source) ⇒ Object



41
42
43
44
# File 'lib/archimate/file_formats/sax/model_exchange_file/view_node.rb', line 41

def on_view_node(view_node, source)
  @view_nodes << view_node if source.parent_handler == self
  view_node
end