Class: Ea::Svg::EaEmitter::Layer

Inherits:
Struct
  • Object
show all
Defined in:
lib/ea/svg/ea_emitter/layer.rb

Overview

A single <g> block ready for inclusion in the SVG output. Carries the style string and the body (one or more child elements: <path>, <polygon>, <text>, <rect>).

Emitters return Arrays of Layer objects. The Document orchestrator either joins them as-is (per-entity ordering) or buckets them by style_key for EA-style grouped output.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



13
14
15
# File 'lib/ea/svg/ea_emitter/layer.rb', line 13

def body
  @body
end

#styleObject

Returns the value of attribute style

Returns:

  • (Object)

    the current value of style



13
14
15
# File 'lib/ea/svg/ea_emitter/layer.rb', line 13

def style
  @style
end

#style_keyObject

Returns the value of attribute style_key

Returns:

  • (Object)

    the current value of style_key



13
14
15
# File 'lib/ea/svg/ea_emitter/layer.rb', line 13

def style_key
  @style_key
end

Instance Method Details

#to_svgObject



14
15
16
# File 'lib/ea/svg/ea_emitter/layer.rb', line 14

def to_svg
  %(<g style="#{style}">\n#{body}\n</g>)
end