Class: ChatCorrect::Punctuation
- Inherits:
-
Object
- Object
- ChatCorrect::Punctuation
- Defined in:
- lib/chat_correct/punctuation.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text:) ⇒ Punctuation
constructor
A new instance of Punctuation.
- #is_punctuation? ⇒ Boolean
Constructor Details
#initialize(text:) ⇒ Punctuation
Returns a new instance of Punctuation.
4 5 6 |
# File 'lib/chat_correct/punctuation.rb', line 4 def initialize(text:) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/chat_correct/punctuation.rb', line 3 def text @text end |
Instance Method Details
#is_punctuation? ⇒ Boolean
8 9 10 11 12 13 14 15 |
# File 'lib/chat_correct/punctuation.rb', line 8 def is_punctuation? text.gsub(/[[:punct:]]/, '').eql?('') || text.eql?('∫') || text.eql?('∬') || text.eql?('∯') || text.eql?('∮') || text.eql?('ƪ') end |