Class: SensitiveWordFilter::Load

Inherits:
Object
  • Object
show all
Defined in:
lib/sensitive_word_filter/load.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_paths) ⇒ Load

Returns a new instance of Load.



6
7
8
9
# File 'lib/sensitive_word_filter/load.rb', line 6

def initialize(file_paths)
  @file_paths = file_paths
  @words = Array.new
end

Instance Attribute Details

#file_pathsObject (readonly)

Returns the value of attribute file_paths.



4
5
6
# File 'lib/sensitive_word_filter/load.rb', line 4

def file_paths
  @file_paths
end

#wordsObject

Returns the value of attribute words.



3
4
5
# File 'lib/sensitive_word_filter/load.rb', line 3

def words
  @words
end

Instance Method Details

#loadObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sensitive_word_filter/load.rb', line 11

def load
  if file_paths.is_a?(Array)
    file_paths.each do |file_path|
      _load(file_path)
    end
  else
    _load(file_paths)
  end

  words
end