Skip to content

Instantly share code, notes, and snippets.

@stouset
Created January 16, 2012 15:30
Show Gist options
  • Save stouset/1621390 to your computer and use it in GitHub Desktop.
Save stouset/1621390 to your computer and use it in GitHub Desktop.
require 'active_support/concern'
module Hash::PurgeIf
include ActiveSupport::Concern
included do |base|
raise 'Hash#purge_if already defined' if
base.instance_methods.include?(:purge_if)
end
def purge_if(...)
...
end
end
class Hash
include Hash::PurgeIf
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment