lib/reality/naming.rb in reality-naming-1.8.0 vs lib/reality/naming.rb in reality-naming-1.9.0

- old
+ new

@@ -12,11 +12,10 @@ # limitations under the License. # module Reality module Naming - class << self def camelize?(word) camelize(word) == word.to_s end @@ -35,9 +34,19 @@ def pascal_case(word) word_parts = split_into_words(word).collect { |part| part[0...1].upcase + part[1..-1] } return word_parts[0] if (word_parts.size == 1 && word_parts[0] == word_parts[0].upcase) word_parts.join('') + end + + def humanize?(word) + humanize(word) == word.to_s + end + + def humanize(word) + word_parts = split_into_words(word).collect { |part| part[0...1].upcase + part[1..-1] } + return word_parts[0] if (word_parts.size == 1 && word_parts[0] == word_parts[0].upcase) + word_parts.join(' ') end def underscore?(word) underscore(word) == word.to_s end