class DataMetaXtra::FileSys::PosixOwn

POSIX ownership information - group and the user

Attributes

g[RW]
u[RW]

Public Class Methods

from(source, kind) click to toggle source

@param [String] source either a String or a {IdName} or nil, see the method {IdName.forName} for details. @param [String] kind the kind of the ownership for diagnostics, user or group @return [IdName] instance according to the description @raise [ArgumentError] if the specs contain invalid character in case of a String or if the source is neither

a String nor a {Perm} nor +nil+
# File lib/dataMetaXtra/fileSys.rb, line 314
def self.from(source, kind)
    case
        when source.kind_of?(NilClass) || source.kind_of?(IdName)
            source
        when source.kind_of?(String)
            IdName.forName(source)
        else
            raise ArgumentError, %<For #{kind} ownership, invalid ownership source: #{source.inspect} >
    end
end
new(user, group = nil) click to toggle source

Convenience constructor @param [IdName] user either the IdName instance or a string, in case of a string, see {IdName.forName}

# File lib/dataMetaXtra/fileSys.rb, line 328
def initialize(user, group = nil)
    @u = PosixOwn.from(user, 'user')
    @g = PosixOwn.from(group, 'group')
end