Method: LinuxStat::User.ids
- Defined in:
- lib/linux_stat/user.rb
.ids ⇒ Object
Returns all the Group ids directories as Hash.
For example: :gid=>0, :bin=>:gid=>1, :daemon=>:gid=>2, :mail=>:gid=>12, :ftp=>:gid=>11}
But if the status isn't available it will return an empty Hash.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/linux_stat/user.rb', line 25 def ids return {} unless passwd_readable? passwd_splitted.reduce({}) { |h, x| h.store(x[0].to_sym, { uid: x[2].to_i, gid: x[3].to_i }) h } end |