Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/hash.rb
Instance Method Summary collapse
Instance Method Details
#[](k) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/hash.rb', line 7 def [](k) return self.orig_acc(k) if self.orig_acc(k) if k.respond_to?(:to_sym) return self.orig_acc(k.to_sym) if self.orig_acc(k.to_sym) end return self.orig_acc(k.to_s) if self.orig_acc(k.to_s) end |
#contains_only?(*args) ⇒ Boolean
2 3 4 |
# File 'lib/hash.rb', line 2 def contains_only?(*args) (keys - args).empty? end |
#orig_acc ⇒ Object
6 |
# File 'lib/hash.rb', line 6 alias_method :orig_acc, :[] |