Class: EhbrsRubyUtils::Music::Sort::Files::Base
- Inherits:
-
Object
- Object
- EhbrsRubyUtils::Music::Sort::Files::Base
- Defined in:
- lib/ehbrs_ruby_utils/music/sort/files/base.rb
Instance Method Summary collapse
- #reorder(new_section, new_order, padding) ⇒ Object
- #source_basename ⇒ Object
- #target_basename ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#reorder(new_section, new_order, padding) ⇒ Object
14 15 16 |
# File 'lib/ehbrs_ruby_utils/music/sort/files/base.rb', line 14 def reorder(new_section, new_order, padding) self.class.new(new_section, new_order, name, original_path, padding) end |
#source_basename ⇒ Object
22 23 24 |
# File 'lib/ehbrs_ruby_utils/music/sort/files/base.rb', line 22 def source_basename original_path.if_present(&:basename) || raise('Original path is blank') end |
#target_basename ⇒ Object
18 19 20 |
# File 'lib/ehbrs_ruby_utils/music/sort/files/base.rb', line 18 def target_basename "#{section}#{order.to_s.rjust(padding, '0')} #{name}" end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/ehbrs_ruby_utils/music/sort/files/base.rb', line 26 def to_s target_basename end |