From 65eab9445cc965dfd1f4d9665661b545e7f0d747 Mon Sep 17 00:00:00 2001 From: randym Date: Sat, 1 Apr 2017 17:51:54 +0900 Subject: fix(two_cell_anchor): spat arguments for start_at, end_at when they are in the options hash --- lib/axlsx/drawing/two_cell_anchor.rb | 7 ++++++- lib/axlsx/util/string.rb | 7 ------- 2 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 lib/axlsx/util/string.rb diff --git a/lib/axlsx/drawing/two_cell_anchor.rb b/lib/axlsx/drawing/two_cell_anchor.rb index b18268f7..d422c0ce 100644 --- a/lib/axlsx/drawing/two_cell_anchor.rb +++ b/lib/axlsx/drawing/two_cell_anchor.rb @@ -37,11 +37,16 @@ module Axlsx drawing.anchors << self @from, @to = Marker.new, Marker.new(:col => 5, :row=>10) parse_options options + + # bit of a hack to work around the fact that the coords for start at and end at + # are passed in as an array when specified in intialization options - however + start_at(*options[:start_at]) if options[:start_at] + end_at(*options[:end_at]) if options[:end_at] end # sets the col, row attributes for the from marker. # @note The recommended way to set the start position for graphical - # objects is directly thru the object. + # objects is directly thru the object. # @see Chart#start_at def start_at(x, y=nil) from.coord x, y diff --git a/lib/axlsx/util/string.rb b/lib/axlsx/util/string.rb deleted file mode 100644 index 8def6e5b..00000000 --- a/lib/axlsx/util/string.rb +++ /dev/null @@ -1,7 +0,0 @@ -unless String.method_defined? :prepend - class String - def prepend(other_str) - insert(0, other_str) - end - end -end \ No newline at end of file -- cgit v1.2.3