From: Joel Pearson Date: 2013-03-14T02:18:23+09:00 Subject: Re: RubyExcel class. Useful? Robert Klemme wrote in post #1101459: > This doesn't look good: > def range=( first_cell, last_cell=nil, val ) > There is no visual separation between coordinates and the value like > there is with []=. Thanks for spotting that, I wasn't sure how to use it. I've completely removed that method; range now returns an object and range.value can get and set its content. > > I always find constructs like this suspicious: > > def cell( row, col ) > Element.new( self, indices_to_address( row, col ) ) > end > > The purpose of a constructor is to construct something and return it > so the caller can do something with it. If you do not do that > everybody is left wondering what happens to the newly created > instance. If you need it only temporary then another method name > would be better. Or change it so that not Element stores itself > somewhere in "self" but rather "self" itself. I'm not really sure what you mean by this. My intention is that cell and cells are like alises for range, but you can select by 1-based indices (again, copying excel). Range is also capable of referring to more than 1 cell, and can take cells as arguments. This allow for purely numerical selection of any area, I've allowed columns to be selected numerically as well. irb(main):053:0> s.cell(1,1) => RubyExcel::Sheet::Element: A1 irb(main):054:0> s.cell(1,1).value => "A1" -- Posted via http://www.ruby-forum.com/.