Class: Teapot::Graph::Extractor

Inherits:
Object
  • Object
show all
Defined in:
lib/teapot/graph.rb

Direct Known Subclasses

Extractors::PreprocessorExtractor

Instance Method Summary collapse

Constructor Details

#initialize(patterns = []) ⇒ Extractor

Returns a new instance of Extractor.



116
117
118
# File 'lib/teapot/graph.rb', line 116

def initialize(patterns = [])
	@patterns = Array(patterns)
end

Instance Method Details

#call(path, &block) ⇒ Object



123
124
125
126
127
128
129
130
131
# File 'lib/teapot/graph.rb', line 123

def call(path, &block)
	return unless path.exist?
	
	basename = path.basename.to_s

	if @patterns.find{|pattern| pattern.match(basename)}
		extract(path, &block)
	end
end

#extract(path) ⇒ Object



120
121
# File 'lib/teapot/graph.rb', line 120

def extract(path)
end