Class: Plexify::Prepare::Source
- Inherits:
-
Object
- Object
- Plexify::Prepare::Source
- Defined in:
- lib/plexify/prepare.rb
Overview
Source class implementation
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#folder ⇒ Object
Returns the value of attribute folder.
Instance Method Summary collapse
-
#initialize(options) ⇒ Source
constructor
Initialize.
-
#prepare ⇒ Object
Prepare source folder.
Constructor Details
#initialize(options) ⇒ Source
Initialize
74 75 76 77 |
# File 'lib/plexify/prepare.rb', line 74 def initialize() @source_path = [:source] @files = Array.new end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
71 72 73 |
# File 'lib/plexify/prepare.rb', line 71 def files @files end |
#folder ⇒ Object
Returns the value of attribute folder.
70 71 72 |
# File 'lib/plexify/prepare.rb', line 70 def folder @folder end |
Instance Method Details
#prepare ⇒ Object
Prepare source folder
80 81 82 83 84 85 86 87 88 |
# File 'lib/plexify/prepare.rb', line 80 def prepare @folder = File.new @source_path if File.exists?(@folder.path) && File.directory?(@folder.path) Dir.glob(@folder.path + "/**/*.{mkv,avi,mov}") do |file| @files << File.open(file) end end end |