Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/exts/hash.rb
Instance Method Summary collapse
- #have(sub) ⇒ Object
-
#to_h ⇒ Object
2.0 ruby 已经自带此方法.
Instance Method Details
#have(sub) ⇒ Object
8 9 10 |
# File 'lib/exts/hash.rb', line 8 def have(sub) self.to_a.include?(sub.to_a[0]) end |
#to_h ⇒ Object
2.0 ruby 已经自带此方法
4 5 6 |
# File 'lib/exts/hash.rb', line 4 def to_h self end |