Class: FileEntry
- Inherits:
-
Object
- Object
- FileEntry
- Defined in:
- lib/filentory/fileentry.rb
Instance Attribute Summary collapse
-
#checksum ⇒ Object
Returns the value of attribute checksum.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(path, name) ⇒ FileEntry
constructor
A new instance of FileEntry.
- #last_modified ⇒ Object
- #last_modified=(date) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path, name) ⇒ FileEntry
Returns a new instance of FileEntry.
4 5 6 7 |
# File 'lib/filentory/fileentry.rb', line 4 def initialize(path, name) @path = path @name = name end |
Instance Attribute Details
#checksum ⇒ Object
Returns the value of attribute checksum.
2 3 4 |
# File 'lib/filentory/fileentry.rb', line 2 def checksum @checksum end |
#metadata ⇒ Object
Returns the value of attribute metadata.
2 3 4 |
# File 'lib/filentory/fileentry.rb', line 2 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/filentory/fileentry.rb', line 2 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
2 3 4 |
# File 'lib/filentory/fileentry.rb', line 2 def path @path end |
#size ⇒ Object
Returns the value of attribute size.
2 3 4 |
# File 'lib/filentory/fileentry.rb', line 2 def size @size end |
Instance Method Details
#last_modified ⇒ Object
13 14 15 |
# File 'lib/filentory/fileentry.rb', line 13 def last_modified DateTime.iso8601(@last_modified) end |
#last_modified=(date) ⇒ Object
9 10 11 |
# File 'lib/filentory/fileentry.rb', line 9 def last_modified=(date) @last_modified = date.strftime("%FT%T%:z") end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/filentory/fileentry.rb', line 17 def to_s @path + @name + " (" + @size.to_s + ") - " + @last_modified end |