On Tue, Feb 19, 2013 at 10:51 AM, Joel Pearson <[email protected]> wrote: > Using the filter method on my previous attempt would return a copy of > the object containing only the required data. I was hoping for something > similar with this so I can split into multiple sections using filter > logic but still keep the original if required, but I'm not sure how to > do this. This is the kind of thing I'd probably want to use: > > m = #Main matrix > n = m.filter args #Creates Subset without altering "m" > m.filter! other_args #Alters its own data
That's another reasonable way to do it. Similar to how String#gsub and String#gsub! go about this. It entirely depends on your use case. If you would want to modify the original data through a view then of course you need a similar approach as with Row and Column. > A class method sounds like a good idea. I'll have to play with that and > see what I can come up with... Cheers 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.
