Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/exts/hash.rb

Instance Method Summary collapse

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_hObject

2.0 ruby 已经自带此方法



4
5
6
# File 'lib/exts/hash.rb', line 4

def to_h
  self
end