Skip to content

Instantly share code, notes, and snippets.

@technicalpickles
Forked from jqr/snippet.rb
Created April 6, 2009 03:17
Show Gist options
  • Save technicalpickles/90627 to your computer and use it in GitHub Desktop.
Save technicalpickles/90627 to your computer and use it in GitHub Desktop.
# Yes this is a terrible idea, but we're just getting started...
module Enumerable
def >(value)
select { |v| v > value }
end
def <(value)
select { |v| v < value }
end
end
a = (1..10).to_a
a > 5 # => [6, 7, 8, 9, 10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment