Class: Catalog::Organizer
- Inherits:
-
Object
- Object
- Catalog::Organizer
- Defined in:
- lib/catalog/organizer.rb
Instance Method Summary collapse
-
#initialize(base_path:) ⇒ Organizer
constructor
A new instance of Organizer.
- #run! ⇒ Object
Constructor Details
#initialize(base_path:) ⇒ Organizer
Returns a new instance of Organizer.
3 4 5 |
# File 'lib/catalog/organizer.rb', line 3 def initialize(base_path:) @base_path = base_path end |
Instance Method Details
#run! ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/catalog/organizer.rb', line 7 def run! new_documents.each do |document| matcher = DrawerMatcher.new(document: document) if matcher.match? DocumentMover.new(document: document, drawer: matcher.drawer).move! end end end |