Skip to content

Instantly share code, notes, and snippets.

@mkwiatkowski
Created December 8, 2013 10:45
Show Gist options
  • Save mkwiatkowski/7855778 to your computer and use it in GitHub Desktop.
Save mkwiatkowski/7855778 to your computer and use it in GitHub Desktop.
$ irb
2.0.0p247 :001 > def link_to(text, address) # <= pasting method definition
2.0.0p247 :002?> p "<a href='#{address}'>#{text}</a>"
2.0.0p247 :003?> end
=> nil
2.0.0p247 :004 > link_to("Bloc", "http://www.bloc.io") # <= manually invoking the method with some arguments
"<a href='http://www.bloc.io'>Bloc</a>" # <= what your method printed
=> "<a href='http://www.bloc.io'>Bloc</a>" # <= what your method returned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment