Module: Mp3gain::Chainable
Overview
Offers methods like path, target_db etc. to be chained together
Instance Attribute Summary collapse
-
#mp3gain ⇒ Object
Returns the value of attribute mp3gain.
Instance Method Summary collapse
- #do_preserve_timestamp(preserve: true) ⇒ Object
- #path(mp3_gain_path) ⇒ Object
- #with_target_db(target_db) ⇒ Object
Instance Attribute Details
#mp3gain ⇒ Object
Returns the value of attribute mp3gain.
7 8 9 |
# File 'lib/mp3gain/chainable.rb', line 7 def mp3gain @mp3gain end |
Instance Method Details
#do_preserve_timestamp(preserve: true) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/mp3gain/chainable.rb', line 23 def (preserve: true) raise 'Please set a path first.' if @mp3gain.nil? @mp3gain. = preserve @mp3gain end |
#path(mp3_gain_path) ⇒ Object
9 10 11 12 13 14 |
# 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) ⇒ Object
16 17 18 19 20 21 |
# 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 |