Class: Torganiser::Arranger

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

Overview

Handles arranging episode files into a collection

Defined Under Namespace

Classes: Destination

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#collectionObject (readonly)

Returns the value of attribute collection.



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

def collection
  @collection
end

#copyObject (readonly)

Returns the value of attribute copy.



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

def copy
  @copy
end

#dry_runObject (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