Class: Lich::Common::SetupFiles::FileInfo

Inherits:
Object
  • Object
show all
Defined in:
documented/common/setup_files.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, name:, data:, mtime:) ⇒ FileInfo

Returns a new instance of FileInfo.



42
43
44
45
46
47
# File 'documented/common/setup_files.rb', line 42

def initialize(path:, name:, data:, mtime:)
  @path = path
  @name = name
  @data = data
  @mtime = mtime
end

Instance Attribute Details

#mtimeObject (readonly)

Returns the value of attribute mtime.



40
41
42
# File 'documented/common/setup_files.rb', line 40

def mtime
  @mtime
end

#nameObject (readonly)

Returns the value of attribute name.



40
41
42
# File 'documented/common/setup_files.rb', line 40

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



40
41
42
# File 'documented/common/setup_files.rb', line 40

def path
  @path
end

Instance Method Details

#dataObject



49
50
51
# File 'documented/common/setup_files.rb', line 49

def data
  Marshal.load(Marshal.dump(@data))
end

#inspectObject



61
62
63
# File 'documented/common/setup_files.rb', line 61

def inspect
  "#<SetupFiles::FileInfo @name=#{@name}, @path=#{@path}, @mtime=#{@mtime}>"
end

#peek(property) ⇒ Object



53
54
55
# File 'documented/common/setup_files.rb', line 53

def peek(property)
  Marshal.load(Marshal.dump(@data[property.to_sym]))
end

#to_sObject



57
58
59
# File 'documented/common/setup_files.rb', line 57

def to_s
  File.join(@path, @name)
end