Class: ChatCorrect::PunctuationMasqueradingAsSpellingError
- Inherits:
-
Object
- Object
- ChatCorrect::PunctuationMasqueradingAsSpellingError
- Defined in:
- lib/chat_correct/punctuation_masquerading_as_spelling_error.rb
Instance Attribute Summary collapse
-
#token_a ⇒ Object
readonly
Returns the value of attribute token_a.
-
#token_b ⇒ Object
readonly
Returns the value of attribute token_b.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(token_a:, token_b:) ⇒ PunctuationMasqueradingAsSpellingError
constructor
A new instance of PunctuationMasqueradingAsSpellingError.
Constructor Details
#initialize(token_a:, token_b:) ⇒ PunctuationMasqueradingAsSpellingError
Returns a new instance of PunctuationMasqueradingAsSpellingError.
4 5 6 7 |
# File 'lib/chat_correct/punctuation_masquerading_as_spelling_error.rb', line 4 def initialize(token_a:, token_b:) @token_a = token_a @token_b = token_b end |
Instance Attribute Details
#token_a ⇒ Object (readonly)
Returns the value of attribute token_a.
3 4 5 |
# File 'lib/chat_correct/punctuation_masquerading_as_spelling_error.rb', line 3 def token_a @token_a end |
#token_b ⇒ Object (readonly)
Returns the value of attribute token_b.
3 4 5 |
# File 'lib/chat_correct/punctuation_masquerading_as_spelling_error.rb', line 3 def token_b @token_b end |
Instance Method Details
#exists? ⇒ Boolean
9 10 11 12 |
# File 'lib/chat_correct/punctuation_masquerading_as_spelling_error.rb', line 9 def exists? (token_a.include?('ƪ') || token_b.include?('ƪ')) && token_a.delete("ƪ").eql?(token_b.delete("ƪ")) end |