Class: FileEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/filentory/fileentry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#checksumObject

Returns the value of attribute checksum.



2
3
4
# File 'lib/filentory/fileentry.rb', line 2

def checksum
  @checksum
end

#metadataObject

Returns the value of attribute metadata.



2
3
4
# File 'lib/filentory/fileentry.rb', line 2

def 
  @metadata
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/filentory/fileentry.rb', line 2

def name
  @name
end

#pathObject

Returns the value of attribute path.



2
3
4
# File 'lib/filentory/fileentry.rb', line 2

def path
  @path
end

#sizeObject

Returns the value of attribute size.



2
3
4
# File 'lib/filentory/fileentry.rb', line 2

def size
  @size
end

Instance Method Details

#last_modifiedObject



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_sObject



17
18
19
# File 'lib/filentory/fileentry.rb', line 17

def to_s
  @path + @name + " (" + @size.to_s + ") - " + @last_modified
end