Class: Whisper::DirSet

Inherits:
Object
  • Object
show all
Includes:
Dependency, Loggy
Defined in:
lib/whisper/dir_set.rb

Overview

maintains a set of things from a directory, where each thing is has both a .yaml and .textile file.

Instance Method Summary collapse

Methods included from Dependency

#content, #dependency_init, #refresh!, #timestamp

Constructor Details

#initialize(dir, klass) ⇒ DirSet

Returns a new instance of DirSet.



12
13
14
15
16
17
# File 'lib/whisper/dir_set.rb', line 12

def initialize dir, klass
  @scanner = DirScanner.new dir, /(#{Regexp.escape ENTRY_METADATA_EXTENSION}|#{Regexp.escape ENTRY_CONTENT_EXTENSION})$/
  @klass = klass

  dependency_init
end

Instance Method Details

#dependenciesObject



19
# File 'lib/whisper/dir_set.rb', line 19

def dependencies; [@scanner] end

#sizeObject



21
# File 'lib/whisper/dir_set.rb', line 21

def size; things.size end

#thingsObject



20
# File 'lib/whisper/dir_set.rb', line 20

def things; content end