Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/equal_rights_for_hash.rb
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/equal_rights_for_hash.rb', line 10 def to_h if respond_to? :to_hash to_hash elsif respond_to? :all? and not all? {|item| item.respond_to? :to_ary } Hash[*self] else Hash[self] end end |