Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/unicase.rb

Instance Method Summary collapse

Instance Method Details

#first_unicode_capitalizeObject



23
24
25
26
27
28
29
# File 'lib/unicase.rb', line 23

def first_unicode_capitalize
  if self =~ /\A(.)/um
    Unicase::Uppercase[$1] + $'
  else
    self.dup
  end
end

#first_unicode_lowercaseObject



31
32
33
34
35
36
37
# File 'lib/unicase.rb', line 31

def first_unicode_lowercase
  if self =~ /\A(.)/um
    Unicase::Lowercase[$1] + $'
  else
    self.dup
  end
end

#unicode_lowercaseObject



39
40
41
42
43
# File 'lib/unicase.rb', line 39

def unicode_lowercase
  res = ""
  each_char { |x| res << Unicase::Lowercase[x] }
  res
end

#unicode_uppercaseObject



44
45
46
47
48
# File 'lib/unicase.rb', line 44

def unicode_uppercase
  res = ""
  each_char { |x| res << Unicase::Uppercase[x] }
  res
end