Class: Tabula::Extractors::ExtractionAlgorithm
- Inherits:
-
Object
- Object
- Tabula::Extractors::ExtractionAlgorithm
- Defined in:
- lib/tabula/extractors/extraction_algorithm.rb
Overview
Base class for table extraction algorithms
Direct Known Subclasses
Class Method Summary collapse
-
.extract(page, **options) ⇒ Array<Table>
Extract tables from a page.
Instance Method Summary collapse
-
#extract(page) ⇒ Array<Table>
Extract tables from a page.
-
#initialize(**options) ⇒ ExtractionAlgorithm
constructor
A new instance of ExtractionAlgorithm.
-
#name ⇒ String
Get algorithm name for table metadata.
Constructor Details
#initialize(**options) ⇒ ExtractionAlgorithm
Returns a new instance of ExtractionAlgorithm.
16 17 18 |
# File 'lib/tabula/extractors/extraction_algorithm.rb', line 16 def initialize(**) @options = end |
Class Method Details
.extract(page, **options) ⇒ Array<Table>
Extract tables from a page
11 12 13 |
# File 'lib/tabula/extractors/extraction_algorithm.rb', line 11 def self.extract(page, **) new(**).extract(page) end |
Instance Method Details
#extract(page) ⇒ Array<Table>
Extract tables from a page
23 24 25 |
# File 'lib/tabula/extractors/extraction_algorithm.rb', line 23 def extract(page) raise NotImplementedError, 'Subclasses must implement #extract' end |
#name ⇒ String
Get algorithm name for table metadata
29 30 31 |
# File 'lib/tabula/extractors/extraction_algorithm.rb', line 29 def name self.class.name.split('::').last end |