On Wed, Mar 13, 2013 at 4:45 PM, Joel Pearson <[email protected]> wrote: > Aha! I have learned how to use Github.
+1 > My hideous-looking, still under-construction code is here: > https://github.com/VirtuosoJoel/RubyExcel > > I've split it into something more resembling an Excel workbook, and > tried to reduce the redundancy of address-based code by adding a module > called Address. > > I'll keep hammering bits onto it, cutting away the dross, and testing it > until it turns into a reasonably serviceable tool. > > As always, any advice is welcome! This doesn't look good: def range=( first_cell, last_cell=nil, val ) Calls will look like this sheet.range= 1, 2, 3 There is no visual separation between coordinates and the value like there is with []=. 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. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- [email protected] | https://groups.google.com/d/forum/ruby-talk-google?hl=en --- You received this message because you are subscribed to the Google Groups "ruby-talk-google" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
