Class: Archimate::Svg::ViewNode

Inherits:
Object
  • Object
show all
Defined in:
lib/archimate/svg/view_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view_node) ⇒ ViewNode

Returns a new instance of ViewNode.



8
9
10
# File 'lib/archimate/svg/view_node.rb', line 8

def initialize(view_node)
  @view_node = view_node
end

Instance Attribute Details

#view_nodeObject (readonly)

Returns the value of attribute view_node.



6
7
8
# File 'lib/archimate/svg/view_node.rb', line 6

def view_node
  @view_node
end

Instance Method Details

#render_elements(svg) ⇒ Object

The info needed to render is contained in the view node with the exception of any offset needed. So this will need to be included in the recursive drawing of children



14
15
16
17
18
19
# File 'lib/archimate/svg/view_node.rb', line 14

def render_elements(svg)
  Nokogiri::XML::Builder.with(svg) do |xml|
    EntityFactory.make_entity(view_node, nil).to_svg(xml)
  end
  svg
end