Sha256: 82f2856d980811472ae7b97c35ce28da73cdac25aace74d523698ccb0399e116
Contents?: true
Size: 1.22 KB
Versions: 3
Compression:
Stored size: 1.22 KB
Contents
module Axlsx # a vml drawing used for comments in excel. class VmlDrawing # creates a new Vml Drawing object. # @param [Comments] the comments object this drawing is associated with def initialize(comments) raise ArgumentError, "you must provide a comments object" unless comments.is_a?(Comments) @comments = comments end # The part name for this vml drawing # @return [String] def pn "#{VML_DRAWING_PN}" % (@comments.worksheet.index + 1) end # serialize the vml_drawing to xml. # @param [String] str # @return [String] def to_xml_string(str = '') str = <<BAD_PROGRAMMER <xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="#{@comments.worksheet.index+1}"/> </o:shapelayout> <v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m0,0l0,21600,21600,21600,21600,0xe"> <v:stroke joinstyle="miter"/> <v:path gradientshapeok="t" o:connecttype="rect"/> </v:shapetype> BAD_PROGRAMMER @comments.each { |comment| comment.vml_shape.to_xml_string str } str << "</xml>" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
axlsx-1.1.7 | lib/axlsx/drawing/vml_drawing.rb |
axlsx-1.1.6 | lib/axlsx/drawing/vml_drawing.rb |
axlsx-1.1.5 | lib/axlsx/drawing/vml_drawing.rb |