Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Added Hash#only for picking out specific attributes

#35

I've added Hash#only (opposite of Hash#except) for picking specific attributes out of a hash:

{:a => 1, :b => 2, :c => 3}.only(:a, :c)

http://github.com/brandon/rails/...

Reported by Brandon Keepers · April 22nd, 2008 @ 02:35 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Cheah Chu Yeow
    Cheah Chu Yeow

    Take a look at Hash#slice in ActiveSupport (slice.rb) :) I think someone opened a similar ticket with patch in Trac before. Personally, I prefer #only but well.

    April 22nd, 2008 @ 05:46 PM

  2. Brandon Keepers
    Brandon Keepers

    Doh, didn't even look for it under that name. Ok, ignore this ticket.

    April 22nd, 2008 @ 07:07 PM

  3. Rick
    Rick
    • State changed from new to invalid

    April 22nd, 2008 @ 08:54 PM