Class: Archiver::Action::Renaming
- Inherits:
-
Object
- Object
- Archiver::Action::Renaming
- Defined in:
- lib/archiver/action/renaming.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#output ⇒ Object
Returns the value of attribute output.
-
#records ⇒ Object
Returns the value of attribute records.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source, destination, output) ⇒ Renaming
constructor
A new instance of Renaming.
- #process ⇒ Object
Constructor Details
#initialize(source, destination, output) ⇒ Renaming
Returns a new instance of Renaming.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/archiver/action/renaming.rb', line 15 def initialize(source, destination, output) @source = source @destination = destination @output = output @records = [] check_directories load_records end |
Instance Attribute Details
#destination ⇒ Object
Returns the value of attribute destination.
10 11 12 |
# File 'lib/archiver/action/renaming.rb', line 10 def destination @destination end |
#output ⇒ Object
Returns the value of attribute output.
11 12 13 |
# File 'lib/archiver/action/renaming.rb', line 11 def output @output end |
#records ⇒ Object
Returns the value of attribute records.
13 14 15 |
# File 'lib/archiver/action/renaming.rb', line 13 def records @records end |
#source ⇒ Object
Returns the value of attribute source.
9 10 11 |
# File 'lib/archiver/action/renaming.rb', line 9 def source @source end |
Instance Method Details
#process ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/archiver/action/renaming.rb', line 26 def process records.each do |record| next unless record.process? record.move destination output.process record end output.finish! end |