Class: EhbrsRubyUtils::Music::Sort::Files::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/music/sort/files/scanner.rb

Instance Method Summary collapse

Instance Method Details

#allObject



14
15
16
# File 'lib/ehbrs_ruby_utils/music/sort/files/scanner.rb', line 14

def all
  by_section.flat_map { |_s, fs| fs }
end

#config_fileObject



18
19
20
# File 'lib/ehbrs_ruby_utils/music/sort/files/scanner.rb', line 18

def config_file
  root.join('.sort')
end

#countInteger

Returns:

  • (Integer)


23
24
25
# File 'lib/ehbrs_ruby_utils/music/sort/files/scanner.rb', line 23

def count
  by_section.values.inject(0) { |a, e| a + e.count }
end

#search(name) ⇒ Object



27
28
29
# File 'lib/ehbrs_ruby_utils/music/sort/files/scanner.rb', line 27

def search(name)
  all.find { |sf| sf.name == name }
end