Class: Restauration::Fichier

Inherits:
Object
  • Object
show all
Defined in:
lib/images/restauration/fichier.rb

Overview

Fichier

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nom_attribue, date, path, extension) ⇒ Fichier

Returns a new instance of Fichier.



12
13
14
15
16
17
18
# File 'lib/images/restauration/fichier.rb', line 12

def initialize(nom_attribue, date, path, extension)
  @nom_attribue = nom_attribue
  @date = date
  @path = path
  @extension = extension
  @type = Classification.get_type(extension)
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



10
11
12
# File 'lib/images/restauration/fichier.rb', line 10

def date
  @date
end

#extensionObject (readonly)

Returns the value of attribute extension.



10
11
12
# File 'lib/images/restauration/fichier.rb', line 10

def extension
  @extension
end

#nom_attribueObject (readonly)

Returns the value of attribute nom_attribue.



10
11
12
# File 'lib/images/restauration/fichier.rb', line 10

def nom_attribue
  @nom_attribue
end

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/images/restauration/fichier.rb', line 10

def path
  @path
end

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/images/restauration/fichier.rb', line 10

def type
  @type
end

Instance Method Details

#path_destinationObject



24
25
26
# File 'lib/images/restauration/fichier.rb', line 24

def path_destination
  "#{@path}/#{DirectoryHelpers.defini_dossier_par(@extension)}/#{@nom_attribue}#{@extension.downcase}"
end

#path_nouveau_nomObject



20
21
22
# File 'lib/images/restauration/fichier.rb', line 20

def path_nouveau_nom
  "#{@path}/#{@nom_attribue}#{@extension.downcase}"
end