Class: Roopap::Organizer
- Inherits:
-
Object
- Object
- Roopap::Organizer
- Defined in:
- lib/roopap/organizer.rb
Instance Method Summary collapse
-
#initialize ⇒ Organizer
constructor
A new instance of Organizer.
- #organized_file_count ⇒ Object
- #perform(source, dest) ⇒ Object
Constructor Details
#initialize ⇒ Organizer
Returns a new instance of Organizer.
8 9 10 |
# File 'lib/roopap/organizer.rb', line 8 def initialize @count = 0 end |
Instance Method Details
#organized_file_count ⇒ Object
22 23 24 |
# File 'lib/roopap/organizer.rb', line 22 def organized_file_count @count end |
#perform(source, dest) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/roopap/organizer.rb', line 12 def perform(source, dest) Pathname.new(source).each_child do |c| src_file_path = c.to_s next unless jpg_file?(src_file_path) target_path = dest_for(src_file_path, dest) copy(src_file_path, target_path) inc_success_number end end |