Method: LinuxStat::User.gids
- Defined in:
- lib/linux_stat/user.rb
.gids ⇒ Object
Returns all the Group identifiers as Hash.
For example:
LinuxStat::User.gids
=> {:root=>0, :bin=>1, :daemon=>2, :mail=>12, :ftp=>11}
But if the status isn’t available it will return an empty Hash.
58 59 60 61 62 63 64 |
# File 'lib/linux_stat/user.rb', line 58 def gids return {} unless passwd_readable? passwd_splitted.reduce({}) { |h, x| h.merge!(x[0].to_sym => x[3].to_i) } end |