Class: TextExtractor::Filldown

Inherits:
Record
  • Object
show all
Defined in:
lib/text_extractor/filldown.rb

Instance Attribute Summary

Attributes inherited from Record

#factory, #regexp, #values

Instance Method Summary collapse

Methods inherited from Record

#build_extraction, #build_regexp, #expand_regexp, #extract_fills, #extract_values, #ignore_regexp, #initialize_inline_values, #match, #options, #regexp_line_ignorer, #regexp_line_stripper, #source, #strip_regexp

Constructor Details

#initialize(*args, **kwargs) ⇒ Filldown

Returns a new instance of Filldown.



5
6
7
8
# File 'lib/text_extractor/filldown.rb', line 5

def initialize(*args, **kwargs)
  @filldown_output = kwargs.delete(:output) || false
  super(*args, **kwargs)
end

Instance Method Details

#extraction(match, fill) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/text_extractor/filldown.rb', line 10

def extraction(match, fill)
  fill.merge!(extract_values(match))

  if @filldown_output
    super
  else
    []
  end
end