Class: ChatCorrect::Punctuation

Inherits:
Object
  • Object
show all
Defined in:
lib/chat_correct/punctuation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject (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

Returns:

  • (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