Skip to content

Instantly share code, notes, and snippets.

@acook
Created September 9, 2011 18:58
Show Gist options
  • Save acook/1207038 to your computer and use it in GitHub Desktop.
Save acook/1207038 to your computer and use it in GitHub Desktop.
Pry session, show-doc string
pry(main)> x = ""
=> ""
pry(main)> cd x
pry(""):1> show-doc chars
From: string.c in Ruby Core (C Method):
Number of lines: 11
visibility: public
signature: chars()
str.each_char {|cstr| block } -> str
str.each_char -> an_enumerator
Passes each character in str to the given block, or returns
an enumerator if no block is given.
"hello".each_char {|c| print c, ' ' }
produces:
h e l l o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment