Class: Hearken::Indexing::AudioTraverser

Inherits:
Object
  • Object
show all
Defined in:
lib/hearken/indexing/audio_traverser.rb

Constant Summary collapse

EXTS =
%w{m4a mp3 ogg wma flac aac}.map {|e| '.'+e }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ AudioTraverser

Returns a new instance of AudioTraverser.



8
9
10
# File 'lib/hearken/indexing/audio_traverser.rb', line 8

def initialize path
  @path = Pathname.new path
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



5
6
7
# File 'lib/hearken/indexing/audio_traverser.rb', line 5

def current
  @current
end

Instance Method Details

#eachObject



12
13
14
# File 'lib/hearken/indexing/audio_traverser.rb', line 12

def each
  @path.find { |child| yield Hearken::Indexing::File.new child, @path if is_audio? child }
end