Class: Media::Command::Probe

Inherits:
Object
  • Object
show all
Defined in:
lib/media/command/probe.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Probe

Returns a new instance of Probe.


7
8
9
10
11
12
13
# File 'lib/media/command/probe.rb', line 7

def initialize(args)
  @options = Array args.fetch(:options, [])
  @input   = args.fetch(:input)
  
  @cmd      = args.fetch(:cmd, 'ffprobe')
  @subshell = args.fetch(:subshell, Subshell)
end

Instance Method Details

#callObject


15
16
17
# File 'lib/media/command/probe.rb', line 15

def call
  @subshell.new(cmd: to_a).call
end

#to_aObject


19
20
21
22
23
24
25
# File 'lib/media/command/probe.rb', line 19

def to_a
  [
    @cmd,
    @options.map(&:to_a),
    @input
  ].flatten
end