Class: LittleWeasel::Preprocessors::PreprocessedWord

Inherits:
Object
  • Object
show all
Defined in:
lib/LittleWeasel/preprocessors/preprocessed_word.rb

Overview

This class represents a word that has passed through Preprocessor::WordPreprocessor processing. Word preprocessors are used to preprocess a word before it is passed to any Filters::WordFilters, and before it is compared against the dictionary for validity. :reek:Attribute, ignored - Fixing this would result in nothing but trivial setter methods

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_word:, preprocessed:, preprocessed_word:, preprocessor:, preprocessor_order:) ⇒ PreprocessedWord

Returns a new instance of PreprocessedWord.



14
15
16
17
18
19
20
# File 'lib/LittleWeasel/preprocessors/preprocessed_word.rb', line 14

def initialize(original_word:, preprocessed:, preprocessed_word:, preprocessor:, preprocessor_order:)
  self.original_word = original_word
  self.preprocessed_word = preprocessed_word
  self.preprocessed = preprocessed
  self.preprocessor = preprocessor
  self.preprocessor_order = preprocessor_order
end

Instance Attribute Details

#original_wordObject

Returns the value of attribute original_word.



12
13
14
# File 'lib/LittleWeasel/preprocessors/preprocessed_word.rb', line 12

def original_word
  @original_word
end

#preprocessedObject

Returns the value of attribute preprocessed.



12
13
14
# File 'lib/LittleWeasel/preprocessors/preprocessed_word.rb', line 12

def preprocessed
  @preprocessed
end

#preprocessed_wordObject

Returns the value of attribute preprocessed_word.



12
13
14
# File 'lib/LittleWeasel/preprocessors/preprocessed_word.rb', line 12

def preprocessed_word
  @preprocessed_word
end

#preprocessorObject

Returns the value of attribute preprocessor.



12
13
14
# File 'lib/LittleWeasel/preprocessors/preprocessed_word.rb', line 12

def preprocessor
  @preprocessor
end

#preprocessor_orderObject

Returns the value of attribute preprocessor_order.



12
13
14
# File 'lib/LittleWeasel/preprocessors/preprocessed_word.rb', line 12

def preprocessor_order
  @preprocessor_order
end

Instance Method Details

#preprocessed?Boolean

Returns true if the word was preprocessed; false, if the word was not preprocessed by this preprocessor.

Returns:

  • (Boolean)


24
25
26
# File 'lib/LittleWeasel/preprocessors/preprocessed_word.rb', line 24

def preprocessed?
  preprocessed
end