Class: Teapot::Graph::Extractor
- Inherits:
-
Object
- Object
- Teapot::Graph::Extractor
show all
- Defined in:
- lib/teapot/graph.rb
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)}
(path, &block)
end
end
|
120
121
|
# File 'lib/teapot/graph.rb', line 120
def (path)
end
|