From 4d16bfc43780e5d3f7368625700b583e3e98217a Mon Sep 17 00:00:00 2001
From: Randy Morgan The recommended way to manage drawings, images and charts is
-Worksheet#add_chart or Worksheet#add_image.
+The recommended way to manage drawings, images and charts is
+Worksheet#add_chart or Worksheet#add_image.
+ This class details a single cell anchor for drawings.
+This class details a single cell anchor for drawings.
+
The drawing that holds this anchor.
++The drawing that holds this anchor. +
A marker that defines the from cell anchor.
++A marker that defines the from cell anchor. +
the height of the graphic object in pixels this is converted to EMU at a 92 -ppi resolution.
++the height of the graphic object in pixels this is converted to EMU at a 92 +ppi resolution. +
The object this anchor hosts.
++The object this anchor hosts. +
the width of the graphic object in pixels.
++the width of the graphic object in pixels. +
The index of this anchor in the drawing.
++The index of this anchor in the drawing. +
Creates a new OneCellAnchor object and an Pic associated with it.
++Creates a new OneCellAnchor object and an Pic associated with it. +
Serializes the anchor.
++Serializes the anchor. +
Creates a new OneCellAnchor object and an Pic associated with it.
++Creates a new OneCellAnchor object and an Pic associated with it. +
a customizable set of options
++a customizable set of options +
the col, row to start at
+ —+the col, row to start at +
the file location of the image you will render
+ —+the file location of the image you will render +
the name attribute for the rendered image
+ —+the name attribute for the rendered image +
the description of the image rendered
+ —+the description of the image rendered +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 39 -def initialize(drawing, ={}) - @drawing = drawing - @width = 0 - @height = 0 - drawing.anchors << self - @from = Marker.new - .each do |o| - self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" - end - @object = Pic.new(self, ) -end+def initialize(drawing, ={}) + @drawing = drawing + @width = 0 + @height = 0 + drawing.anchors << self + @from = Marker.new + .each do |o| + self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" + end + @object = Pic.new(self, ) +end +
The drawing that holds this anchor
++The drawing that holds this anchor +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 18 -def drawing - @drawing -end+def drawing + @drawing +end +
A marker that defines the from cell anchor. The default from column and row -are 0 and 0 respectively
++A marker that defines the from cell anchor. The default from column and row +are 0 and 0 respectively +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 10 -def from - @from -end+def from + @from +end +
the height of the graphic object in pixels this is converted to EMU at a 92 -ppi resolution
++the height of the graphic object in pixels this is converted to EMU at a 92 +ppi resolution +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 28 -def height - @height -end+def height + @height +end +
The object this anchor hosts
++The object this anchor hosts +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 14 -def object - @object -end+def object + @object +end +
the width of the graphic object in pixels. this is converted to EMU at a 92 -ppi resolution
++the width of the graphic object in pixels. this is converted to EMU at a 92 +ppi resolution +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 23 -def width - @width -end+def width + @width +end +
The index of this anchor in the drawing
++The index of this anchor in the drawing +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 59 -def index - @drawing.anchors.index(self) -end+def index + @drawing.anchors.index(self) +end +
Serializes the anchor
++Serializes the anchor +
The document builder instance this objects xml will be added to.
++The document builder instance this objects xml will be added to. +
# File 'lib/axlsx/drawing/one_cell_anchor.rb', line 66 -def to_xml(xml) - xml.send('xdr:oneCellAnchor') { - xml.send('xdr:from') { - from.to_xml(xml) - } - xml.send('xdr:ext', ext) - @object.to_xml(xml) - xml.send('xdr:clientData') - } -end+def to_xml(xml) + xml.send('xdr:oneCellAnchor') { + xml.send('xdr:from') { + from.to_xml(xml) + } + xml.send('xdr:ext', ext) + @object.to_xml(xml) + xml.send('xdr:clientData') + } +end +