Class: LittleWeasel::Metadata::InvalidWordsServiceResults
- Inherits:
-
Object
- Object
- LittleWeasel::Metadata::InvalidWordsServiceResults
- Defined in:
- lib/LittleWeasel/metadata/invalid_words_service_results.rb
Overview
This class provides a container for the results of the InvalidWordsService service.
Instance Attribute Summary collapse
-
#current_invalid_word_bytesize ⇒ Object
Returns the value of attribute current_invalid_word_bytesize.
-
#max_invalid_words_bytesize ⇒ Object
Returns the value of attribute max_invalid_words_bytesize.
-
#max_invalid_words_bytesize_on ⇒ Object
private
Returns the value of attribute max_invalid_words_bytesize_on.
Instance Method Summary collapse
- #cache_invalid_words? ⇒ Boolean
-
#initialize(max_invalid_words_bytesize_on:, current_invalid_word_bytesize:, max_invalid_words_bytesize:) ⇒ InvalidWordsServiceResults
constructor
A new instance of InvalidWordsServiceResults.
- #off? ⇒ Boolean
- #on? ⇒ Boolean
- #value ⇒ Object
- #value_exceeded? ⇒ Boolean
Constructor Details
#initialize(max_invalid_words_bytesize_on:, current_invalid_word_bytesize:, max_invalid_words_bytesize:) ⇒ InvalidWordsServiceResults
Returns a new instance of InvalidWordsServiceResults.
11 12 13 14 15 16 17 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 11 def initialize(max_invalid_words_bytesize_on:, current_invalid_word_bytesize:, max_invalid_words_bytesize:) self.max_invalid_words_bytesize_on = max_invalid_words_bytesize_on self.current_invalid_word_bytesize = current_invalid_word_bytesize self.max_invalid_words_bytesize = max_invalid_words_bytesize end |
Instance Attribute Details
#current_invalid_word_bytesize ⇒ Object
Returns the value of attribute current_invalid_word_bytesize.
8 9 10 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 8 def current_invalid_word_bytesize @current_invalid_word_bytesize end |
#max_invalid_words_bytesize ⇒ Object
Returns the value of attribute max_invalid_words_bytesize.
9 10 11 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 9 def max_invalid_words_bytesize @max_invalid_words_bytesize end |
#max_invalid_words_bytesize_on ⇒ Object (private)
Returns the value of attribute max_invalid_words_bytesize_on.
41 42 43 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 41 def max_invalid_words_bytesize_on @max_invalid_words_bytesize_on end |
Instance Method Details
#cache_invalid_words? ⇒ Boolean
35 36 37 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 35 def cache_invalid_words? on? && !value_exceeded? end |
#off? ⇒ Boolean
23 24 25 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 23 def off? !on? end |
#on? ⇒ Boolean
19 20 21 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 19 def on? max_invalid_words_bytesize_on end |
#value ⇒ Object
27 28 29 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 27 def value max_invalid_words_bytesize end |
#value_exceeded? ⇒ Boolean
31 32 33 |
# File 'lib/LittleWeasel/metadata/invalid_words_service_results.rb', line 31 def value_exceeded? on? && current_invalid_word_bytesize > max_invalid_words_bytesize end |