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



11
12
13
# File 'lib/ehbrs_ruby_utils/music/sort/files/scanner.rb', line 11

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

#config_fileObject



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

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

#countInteger

Returns:

  • (Integer)


20
21
22
# File 'lib/ehbrs_ruby_utils/music/sort/files/scanner.rb', line 20

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

#search(name) ⇒ Object



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

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