Skip to content

Commit

Permalink
Add aliases so full Hash spec works with Hashie::Mash.
Browse files Browse the repository at this point in the history
Hashes have a number of alternates to .has_key? which are shown at
http://www.ruby-doc.org/core/classes/Hash.html#M000767 This commit
adds those aliases for Hashie::Mash#key?
  • Loading branch information
nuclearsandwich committed Sep 6, 2011
1 parent 5513b96 commit 465587d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/hashie/mash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def dup
def key?(key)
super(convert_key(key))
end
alias_method :has_key?, :key?
alias_method :include?, :key?
alias_method :member?, :key?

# Performs a deep_update on a duplicate of the
# current mash.
Expand Down

0 comments on commit 465587d

Please sign in to comment.