| Class | TaskJuggler::Painter::Element |
| In: |
lib/taskjuggler/Painter/Element.rb
|
| Parent: | Object |
Create a new Element. type specifies the type of the element. attrs is a list of the supported attributes. values is a hash of the provided attributes.
# File lib/taskjuggler/Painter/Element.rb, line 30 def initialize(type, attrs, values) @type = type @attributes = attrs @values = {} @text = nil values.each do |k, v| unless @attributes.include?(k) raise ArgumentError, "Unsupported attribute #{k}" end @values[k] = v end end
Convert the Element into an XMLElement tree using SVG syntax.
# File lib/taskjuggler/Painter/Element.rb, line 45 def to_svg el = XMLElement.new(@type, valuesToSVG) el << XMLText.new(@text) if @text el end