DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR RUBY
rails filter hashes by key value
{ :a => 1, :b => 2, :c => 3 }.select { |k, v| k != :a && v.even? } # => { :b => 2 }
Source by riptutorial.com #
PREVIOUS
NEXT
Tagged:
#rails
#filter
#hashes
#key
ADD COMMENT
Topic
COMMENT
Name
4+1 =
Submit