Class: YoutubeTools::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/youtube_tools/converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}) ⇒ Converter

Returns a new instance of Converter.



5
6
7
8
9
10
11
12
# File 'lib/youtube_tools/converter.rb', line 5

def initialize(file, options={})			
	@folder = options[:path].nil? ? FOLDER_PATH : options[:path]
	@format = options[:format].nil? ? :mp3 : options[:format]
	
	@file = "#{@folder}/#{file}"
	
	converter_to(@format)
end

Instance Attribute Details

#fileObject

Returns the value of attribute file.



3
4
5
# File 'lib/youtube_tools/converter.rb', line 3

def file
  @file
end

#file_nameObject

Returns the value of attribute file_name.



3
4
5
# File 'lib/youtube_tools/converter.rb', line 3

def file_name
  @file_name
end

#folderObject

Returns the value of attribute folder.



3
4
5
# File 'lib/youtube_tools/converter.rb', line 3

def folder
  @folder
end

#formatObject

Returns the value of attribute format.



3
4
5
# File 'lib/youtube_tools/converter.rb', line 3

def format
  @format
end