Class: EhbrsRubyUtils::Videos::File

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/videos/file.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_file(path) ⇒ Object



12
13
14
# File 'lib/ehbrs_ruby_utils/videos/file.rb', line 12

def from_file(path)
  new(path)
end

Instance Method Details

#duration ⇒ ActiveSupport::Duration?

Returns:

  • (ActiveSupport::Duration, nil)


32
33
34
35
36
37
38
# File 'lib/ehbrs_ruby_utils/videos/file.rb', line 32

def duration
  probe_data[:format].if_present do |x|
    x[:duration].if_present do |v|
      ::ActiveSupport::Duration.build(v.to_f)
    end
  end
end

#lyrics_by_provider(provider) ⇒ UltimateLyrics::Lyrics

Parameters:

  • provider (UltimateLyrics::Provider)

Returns:

  • (UltimateLyrics::Lyrics)


42
43
44
# File 'lib/ehbrs_ruby_utils/videos/file.rb', line 42

def lyrics_by_provider(provider)
  ::UltimateLyrics::ProviderSearch.new(provider, ).lyrics
end