Class: Cejo::Media::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/cejo/media/get/info.rb

Overview

Media information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, codec, current) ⇒ Info

Returns a new instance of Info.



12
13
14
15
16
17
# File 'lib/cejo/media/get/info.rb', line 12

def initialize(url, codec, current)
  @url = url
  @codec = codec
  @current = current
  @parser = Cejo::Media::Parser.new(current, url)
end

Instance Attribute Details

#codecObject

Returns the value of attribute codec.



10
11
12
# File 'lib/cejo/media/get/info.rb', line 10

def codec
  @codec
end

#currentObject (readonly)

Returns the value of attribute current.



9
10
11
# File 'lib/cejo/media/get/info.rb', line 9

def current
  @current
end

#parserObject

Returns the value of attribute parser.



10
11
12
# File 'lib/cejo/media/get/info.rb', line 10

def parser
  @parser
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/cejo/media/get/info.rb', line 9

def url
  @url
end

Instance Method Details

#audio_commandObject



27
28
29
# File 'lib/cejo/media/get/info.rb', line 27

def audio_command
  "#{program} #{current.out} '#{current.title}.#{current.ext}' #{current.audio} #{codec} #{url}"
end

#extensionObject



31
32
33
34
# File 'lib/cejo/media/get/info.rb', line 31

def extension
  parser.fmt = :ext
  parser.result
end

#programObject



19
20
21
# File 'lib/cejo/media/get/info.rb', line 19

def program
  current.name
end

#titleObject



36
37
38
39
# File 'lib/cejo/media/get/info.rb', line 36

def title
  parser.fmt = :title
  parser.result
end

#to_sObject



49
50
51
# File 'lib/cejo/media/get/info.rb', line 49

def to_s
  "#{title}.#{extension}"
end

#video_commandObject



23
24
25
# File 'lib/cejo/media/get/info.rb', line 23

def video_command
  "#{program} #{current.out} '#{current.title}.#{current.ext}' #{current.video} #{codec} #{url}"
end