module Mp3gain::Chainable

Offers methods like path, target_db etc. to be chained together

Attributes

mp3gain[RW]

Public Instance Methods

do_preserve_timestamp(preserve: true) click to toggle source
# File lib/mp3gain/chainable.rb, line 23
def do_preserve_timestamp(preserve: true)
  raise 'Please set a path first.' if @mp3gain.nil?

  @mp3gain.preserve_timestamp = preserve
  @mp3gain
end
path(mp3_gain_path) click to toggle source
# File lib/mp3gain/chainable.rb, line 9
def path(mp3_gain_path)
  raise ArgumentError, 'Mp3gain path can\'t be null' if mp3_gain_path.nil?

  @mp3gain = Mp3gain.new(mp3_gain_path)
  @mp3gain.mp3gain = @mp3gain
end
with_target_db(target_db) click to toggle source
# File lib/mp3gain/chainable.rb, line 16
def with_target_db(target_db)
  raise 'Please set a path first.' if @mp3gain.nil?

  @mp3gain.target_db = target_db
  @mp3gain
end