Class: String

Inherits:
Object show all
Defined in:
lib/clevic/extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_charObject

just grab the character code of the last character in the string TODO this won’t work in unicode or utf-8



41
42
43
44
45
46
47
# File 'lib/clevic/extensions.rb', line 41

def to_char
  if RUBY_VERSION <= '1.8.6'
    self[0]
  else
    bytes.first
  end
end