Module: Pomodoro::Tools

Defined in:
lib/pomodoro/tools.rb

Class Method Summary collapse

Class Method Details

.unsentence(possible_sentense) ⇒ Object


5
6
7
8
9
10
11
12
13
# File 'lib/pomodoro/tools.rb', line 5

def self.unsentence(possible_sentense)
  words = possible_sentense.split(' ')

  if words[0] =~ /^[A-Z][a-z]+$/
    words[0].sub!(/^(.)/) { Regexp.last_match(1).downcase }
  end

  words.join(' ').chomp('.')
end