Class: SimpleTextExtract::TextExtractor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename: nil, raw: nil, filepath: nil, tempfile: nil) ⇒ TextExtractor

Returns a new instance of TextExtractor.



7
8
9
# File 'lib/simple_text_extract/text_extractor.rb', line 7

def initialize(filename: nil, raw: nil, filepath: nil, tempfile: nil)
  @file = get_file(filename: filename, raw: raw, filepath: filepath, tempfile: tempfile)
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



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

def file
  @file
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/simple_text_extract/text_extractor.rb', line 11

def to_s
  @to_s ||= extract.to_s
end