Class: SimpleTextExtract::FormatExtractor::Base

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

Direct Known Subclasses

Doc, DocX, PDF, PlainText, Xls, XlsX

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Base

Returns a new instance of Base.



10
11
12
# File 'lib/simple_text_extract/format_extractor/base.rb', line 10

def initialize(file)
  @file = file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



8
9
10
# File 'lib/simple_text_extract/format_extractor/base.rb', line 8

def file
  @file
end

Instance Method Details

#extractObject



14
15
# File 'lib/simple_text_extract/format_extractor/base.rb', line 14

def extract
end

#missing_dependency?(command) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/simple_text_extract/format_extractor/base.rb', line 17

def missing_dependency?(command)
  dependency = `bash -c 'command -v #{command}'`
  dependency.nil? || dependency.empty?
end