class WordCountAnalyzer::Punctuation

Constants

DASHED_LINE_REGEX

Rubular: rubular.com/r/RjZ7qi0uFf

DOTTED_LINE_REGEX

Rubular: rubular.com/r/ZVBsZVkiqC

STRAY_PUNCTUATION_REGEX

Rubular: rubular.com/r/FexKxGUuIe

UNDERSCORE_REGEX

Rubular: rubular.com/r/hNofimZwdh

Attributes

string[R]

Public Class Methods

new(string:) click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 16
def initialize(string:)
  @string = string
end

Public Instance Methods

dashed_line_ocurrances() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 24
def dashed_line_ocurrances
  string.scan(DASHED_LINE_REGEX).size
end
dotted_line_ocurrances() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 20
def dotted_line_ocurrances
  string.scan(DOTTED_LINE_REGEX).size
end
replace_dashed_line() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 40
def replace_dashed_line
  string.gsub(DASHED_LINE_REGEX, '')
end
replace_dotted_line() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 36
def replace_dotted_line
  string.gsub(DOTTED_LINE_REGEX, '')
end
replace_stray_punctuation() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 48
def replace_stray_punctuation
  string.gsub(STRAY_PUNCTUATION_REGEX, '')
end
replace_underscore() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 44
def replace_underscore
  string.gsub(UNDERSCORE_REGEX, '')
end
stray_punctuation_occurences() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 32
def stray_punctuation_occurences
  string.scan(STRAY_PUNCTUATION_REGEX).size
end
underscore_ocurrances() click to toggle source
# File lib/word_count_analyzer/punctuation.rb, line 28
def underscore_ocurrances
  string.scan(UNDERSCORE_REGEX).size
end