Class: Archimate::FileFormats::Sax::Archi::ViewNode

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

Instance Attribute Summary

Attributes inherited from Handler

#attrs, #element_type, #name, #parent_handler

Instance Method Summary collapse

Methods included from Style

#style

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.



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

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



21
22
23
24
25
26
27
28
# File 'lib/archimate/file_formats/sax/archi/view_node.rb', line 21

def complete
  [
    event(:on_future, Sax::FutureReference.new(view_node, :view_refs, attrs["model"])),
    event(:on_future, Sax::FutureReference.new(view_node, :element, attrs["archimateElement"])),
    event(:on_referenceable, view_node),
    event(:on_view_node, view_node)
  ]
end

#on_bounds(bounds, _source) ⇒ Object



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

def on_bounds(bounds, _source)
  @bounds = bounds
  false
end

#on_connection(connection, source) ⇒ Object



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

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

#on_content(string, _source) ⇒ Object



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

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

#on_view_node(view_node, source) ⇒ Object



30
31
32
33
# File 'lib/archimate/file_formats/sax/archi/view_node.rb', line 30

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