Custom string iterators

Methods
A
E
Class Public methods
append_features(base)
# File activesupport/lib/active_support/core_ext/string/iterators.rb, line 8
def self.append_features(base)
  super unless '1.9'.respond_to?(:each_char)
end
Instance Public methods
each_char()

Yields a single-character string for each character in the string. When $KCODE = 'UTF8', multi-byte characters are yielded appropriately.

# File activesupport/lib/active_support/core_ext/string/iterators.rb, line 14
def each_char
  scanner, char = StringScanner.new(self), /./u
  while c = scanner.scan(char)
    yield c
  end
end