module Paf::CoreExt::String
Extend the core String
class with PAF specific processing
Public Instance Methods
but_last_word()
click to toggle source
# File lib/paf/core_ext/string.rb, line 17 def but_last_word self[0...rindex(' ')] end
exception?()
click to toggle source
# File lib/paf/core_ext/string.rb, line 5 def exception? !/^(.|[\d][[:alpha:]]|[\d].*?[\d][[:alpha:]]?)$/.match(self).nil? end
last_word()
click to toggle source
# File lib/paf/core_ext/string.rb, line 13 def last_word split.last end
split_exception?()
click to toggle source
# File lib/paf/core_ext/string.rb, line 9 def split_exception? last_word.exception? && /^\d+$/.match(last_word).nil? end