From: Robert Klemme Date: 2013-02-19T19:03:01+09:00 Subject: Re: Select "columns" from multidimensional array? On Tue, Feb 19, 2013 at 10:51 AM, Joel Pearson 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/