Class: Giblish::LoadAdocSrcFromFile

Inherits:
Object
  • Object
show all
Defined in:
lib/giblish/search/textsearcher.rb

Overview

reads all lines in the given file at instantiation and washes the text from some adoc formatting sequences.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filepath) ⇒ LoadAdocSrcFromFile

Returns a new instance of LoadAdocSrcFromFile.



12
13
14
15
16
17
# File 'lib/giblish/search/textsearcher.rb', line 12

def initialize(filepath)
  @src_lines = []
  File.readlines(filepath.to_s, chomp: true, encoding: "UTF-8").each do |line|
    @src_lines << wash_line(line)
  end
end

Instance Attribute Details

#src_linesObject (readonly)

Returns the value of attribute src_lines.



10
11
12
# File 'lib/giblish/search/textsearcher.rb', line 10

def src_lines
  @src_lines
end