Class: Mediakit::Drivers::AbstractFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/mediakit/drivers.rb

Direct Known Subclasses

FFmpeg, FFprobe, Sox

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.bin_pathObject

Returns the value of attribute bin_path.



92
93
94
# File 'lib/mediakit/drivers.rb', line 92

def bin_path
  @bin_path
end

Class Method Details

.binObject



102
103
104
# File 'lib/mediakit/drivers.rb', line 102

def bin
  bin_path || name
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



94
95
96
# File 'lib/mediakit/drivers.rb', line 94

def configure(&block)
  yield(self)
end

.nameObject



98
99
100
# File 'lib/mediakit/drivers.rb', line 98

def name
  self.to_s.downcase.split('::').last
end

.new(type = :popen) ⇒ Object



106
107
108
109
110
111
112
113
114
115
# File 'lib/mediakit/drivers.rb', line 106

def new(type = :popen)
  case type.to_sym
  when :popen
    PopenDriver.new(bin)
  when :fake
    FakeDriver.new(bin)
  else
    raise(ArgumentError)
  end
end