Class: ImageMover

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_path, destination_path) ⇒ ImageMover

ImageMover.new(“/Users/robertjan/Pictures/Foto’s/camera”, “/Volumes/pictures/photos/Import”).move



9
10
11
12
# File 'lib/image_mover.rb', line 9

def initialize source_path, destination_path
  @source_path = source_path
  @destination_path = destination_path
end

Instance Attribute Details

#destination_pathObject (readonly)

Returns the value of attribute destination_path.



6
7
8
# File 'lib/image_mover.rb', line 6

def destination_path
  @destination_path
end

#source_pathObject (readonly)

Returns the value of attribute source_path.



6
7
8
# File 'lib/image_mover.rb', line 6

def source_path
  @source_path
end

Instance Method Details

#moveObject



14
15
16
17
18
# File 'lib/image_mover.rb', line 14

def move
  Dir.glob("#{source_path}/**/*.jpg").each do |filename|
    move_file filename
  end
end