From: Joel Pearson Date: 2013-03-09T10:33:59+09:00 Subject: Re: RubyExcel class. Useful? Good point Andrew. Writing a thorough demo is a good way to systematically test every method as well. I just tried to demo some of the newer stuff I added and I've already found a couple of bugs where I have class methods referenced rather than the mix-in methods I changed to recently. I'll run a thorough series of tests, build up some examples, and then try again. This covers some of the basics anyway: irb(main):002:0> re = RubyExcel.new.test => RubyExcel => columns: 4, rows: 6, values: 24 irb(main):003:0> puts re a b c d e f g h i j k l m n o p q r s t u v w x => nil irb(main):004:0> re['B2'] = 'z' => "z" irb(main):005:0> re.column_by_header('c').map! { |el| el.next } => Class: RubyExcel::Column, Index: C irb(main):006:0> puts re a b d d e z h h i j l l m n p p q r t t u v x x => nil irb(main):007:0> re.delete_column('D') => RubyExcel => columns: 3, rows: 6, values: 18 irb(main):008:0> re.cell(2,3).value = 'z' => "z" irb(main):009:0> puts re a b d e z z i j l m n p q r t u v x => nil irb(main):010:0> re += [ %w(1 2 3) ] => RubyExcel => columns: 3, rows: 7, values: 21 irb(main):011:0> puts re a b d e z z i j l m n p q r t u v x 1 2 3 => nil irb(main):012:0> re.filter!('b') { |el| el =~ /[a-r]/ } => RubyExcel => columns: 3, rows: 4, values: 12 irb(main):013:0> puts re a b d i j l m n p q r t => nil irb(main):014:0> re.row(2)['A'] = 'q' => "q" irb(main):015:0> re.summarise 'a' => {"q"=>2, "m"=>1} irb(main):016:0> puts re a b d q j l m n p q r t => nil irb(main):017:0> puts re.uniq! 'a' a b d q j l m n p => nil -- Posted via http://www.ruby-forum.com/.