Class: Ykutils::FilePermision::PermisionEntry

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

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ PermisionEntry

Returns a new instance of PermisionEntry.



6
7
8
9
10
# File 'lib/ykutils/filepermision.rb', line 6

def initialize(str)
  @read = str[0].chr
  @write = str[1].chr
  @exec = str[2].chr
end

Instance Method Details

#to_hashObject



16
17
18
# File 'lib/ykutils/filepermision.rb', line 16

def to_hash
  { "read" => @read, "write" => @write, "exec" => @exec }
end

#to_sObject



12
13
14
# File 'lib/ykutils/filepermision.rb', line 12

def to_s
  @read + @write + @exec
end