This is my code:
def weirdcase (string) string.chars.map.with_index {|letter, index| unless index.odd?; letter = letter.upcase else letter end}.compact.join("")