Class: Lich::Common::SetupFiles::FileInfo
- Inherits:
-
Object
- Object
- Lich::Common::SetupFiles::FileInfo
- Defined in:
- documented/common/setup_files.rb
Instance Attribute Summary collapse
-
#mtime ⇒ Object
readonly
Returns the value of attribute mtime.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(path:, name:, data:, mtime:) ⇒ FileInfo
constructor
A new instance of FileInfo.
- #inspect ⇒ Object
- #peek(property) ⇒ Object
- #to_s ⇒ Object
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
#mtime ⇒ Object (readonly)
Returns the value of attribute mtime.
40 41 42 |
# File 'documented/common/setup_files.rb', line 40 def mtime @mtime end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40 41 42 |
# File 'documented/common/setup_files.rb', line 40 def name @name end |
#path ⇒ Object (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
#data ⇒ Object
49 50 51 |
# File 'documented/common/setup_files.rb', line 49 def data Marshal.load(Marshal.dump(@data)) end |
#inspect ⇒ Object
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_s ⇒ Object
57 58 59 |
# File 'documented/common/setup_files.rb', line 57 def to_s File.join(@path, @name) end |