Skip to content

Instantly share code, notes, and snippets.

@mikelikesbikes
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save mikelikesbikes/8809504 to your computer and use it in GitHub Desktop.

Select an option

Save mikelikesbikes/8809504 to your computer and use it in GitHub Desktop.

Revisions

  1. mikelikesbikes revised this gist Feb 4, 2014. No changes.
  2. mikelikesbikes revised this gist Feb 4, 2014. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    # What'chu doin' ruby?

    $ ruby -e "a = (0..5).to_a; c = a.map do |x| x*2; end; p c.class"
    Array
    $ ruby -e "a = (0..5).to_a; c = a.map { |x| x*2; }; p c.class"
  3. mikelikesbikes renamed this gist Feb 4, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. mikelikesbikes created this gist Feb 4, 2014.
    11 changes: 11 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # What'chu doin' ruby?

    $ ruby -e "a = (0..5).to_a; c = a.map do |x| x*2; end; p c.class"
    Array
    $ ruby -e "a = (0..5).to_a; c = a.map { |x| x*2; }; p c.class"
    Array

    $ ruby -e "a = (0..5).to_a; p a.map do |x| x*2; end"
    #<Enumerator: [0, 1, 2, 3, 4, 5]:map>
    $ ruby -e "a = (0..5).to_a; p a.map { |x| x*2; }"
    [0, 2, 4, 6, 8, 10]