lib/noble_names.rb
# Capitalizes a word if it needs to be capitalized.
# @param [String] word the word that needs to be capitalized.
# @return [String] word the word either capitalized or not.
Capitalizes a word if it needs to be capitalized.
Capitalizes a word if it needs to be capitalized .
def noble_capitalize(word)
      prefix = Data.nobility_prefixes.prefix?(word)
      if Data.nobility_particles.in_particle_list?(word)
        word.downcase
      elsif prefix
        capitalize(prefix) + capitalize(word.gsub(prefix, ''))
      else
        capitalize(word)
      end
    end
def noble_capitalize ( word ) prefix = Data . nobility_prefixes . prefix? ( word ) if Data . nobility_particles . in_particle_list? ( word ) word . downcase elsif prefix capitalize ( prefix ) + capitalize ( word . gsub ( prefix , '' ) ) else capitalize ( word ) end end
Capitalizes a word if it needs to be capitalized.
Capitalizes a word if it needs to be capitalized .
word the word either capitalized or not.
word the word either capitalized or not .
String
word
<not_specific>
<not_specific>
word the word that needs to be capitalized.
word the word that needs to be capitalized .