Class: ImageMover
- Inherits:
-
Object
- Object
- ImageMover
- Defined in:
- lib/image_mover.rb
Instance Attribute Summary collapse
-
#destination_path ⇒ Object
readonly
Returns the value of attribute destination_path.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
-
#initialize(source_path, destination_path) ⇒ ImageMover
constructor
ImageMover.new(“/Users/robertjan/Pictures/Foto’s/camera”, “/Volumes/pictures/photos/Import”).move.
- #move ⇒ Object
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_path ⇒ Object (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_path ⇒ Object (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
#move ⇒ Object
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 |