Class: Hash

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

Direct Known Subclasses

PermissionsHash

Instance Method Summary collapse

Instance Method Details

#to_hashObject



6
7
8
9
10
11
# File 'lib/permissions_hash.rb', line 6

def to_hash
  inject({}) do |h, (k,v)|
    v = v.is_a?(Hash) ? v.to_hash : v
    h.merge!({k => v})
  end
end

#to_hash!Object



2
3
4
# File 'lib/permissions_hash.rb', line 2

def to_hash!
  replace to_hash
end