Class: Ddr::Extraction::Extractor
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Ddr::Extraction::Extractor
- Defined in:
- lib/ddr/extraction/extractor.rb
Overview
The Extractor is the main public class.
It works by delegating to an adapter that does the real work.
extractor = Ddr::Extraction::Extractor.build(:tika)
text = extractor.extract(:text, "/path/to/text/file")
puts text.read
...
Class Method Summary collapse
-
.build(adapter_name = nil) {|extractor| ... } ⇒ Object
Returns/yields an extractor instance.
Class Method Details
.build(adapter_name = nil) {|extractor| ... } ⇒ Object
Returns/yields an extractor instance
27 28 29 30 31 32 |
# File 'lib/ddr/extraction/extractor.rb', line 27 def build(adapter_name = nil) adapter = Adapters.get_adapter(adapter_name) extractor = new(adapter.new) yield extractor if block_given? extractor end |