Class: Torganiser::Arranger
- Inherits:
-
Object
- Object
- Torganiser::Arranger
- Defined in:
- lib/torganiser/arranger.rb
Overview
Handles arranging episode files into a collection
Defined Under Namespace
Classes: Destination
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#copy ⇒ Object
readonly
Returns the value of attribute copy.
-
#dry_run ⇒ Object
readonly
Returns the value of attribute dry_run.
Instance Method Summary collapse
- #arrange(file) ⇒ Object
-
#initialize(collection, dry_run: false, copy: false) ⇒ Arranger
constructor
A new instance of Arranger.
Constructor Details
#initialize(collection, dry_run: false, copy: false) ⇒ Arranger
Returns a new instance of Arranger.
8 9 10 11 12 |
# File 'lib/torganiser/arranger.rb', line 8 def initialize(collection, dry_run: false, copy: false) @collection = collection @dry_run = dry_run @copy = copy end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
6 7 8 |
# File 'lib/torganiser/arranger.rb', line 6 def collection @collection end |
#copy ⇒ Object (readonly)
Returns the value of attribute copy.
6 7 8 |
# File 'lib/torganiser/arranger.rb', line 6 def copy @copy end |
#dry_run ⇒ Object (readonly)
Returns the value of attribute dry_run.
6 7 8 |
# File 'lib/torganiser/arranger.rb', line 6 def dry_run @dry_run end |
Instance Method Details
#arrange(file) ⇒ Object
14 15 16 17 |
# File 'lib/torganiser/arranger.rb', line 14 def arrange(file) episode = EpisodeFile.new(file) arrange_episode(episode) end |