Skip to content

Instantly share code, notes, and snippets.

@systemnate
Created January 5, 2016 19:01
Show Gist options
  • Save systemnate/13d45f37abd8b11e0c8d to your computer and use it in GitHub Desktop.
Save systemnate/13d45f37abd8b11e0c8d to your computer and use it in GitHub Desktop.
Ruby Toolbox
Ruby Version Manager
rvm list # - View available ruby versions
rvm use 2.3.0 # - Use version 2.3.0 (if installed)
rvm install 2.3.0 # - Install version 2.3.0 (if not installed)
-----------------
String methods
-----------------
"hello".capitalize # => "Hello"
"nxte dxlo".gsub('x','a') # => "nate dalo"
"a".succ # => "b"
-----------------
Array methods
-----------------
[1,2,3].inject(:+) # => 6
[1,2,3].map(&:to_s) # => ["1", "2", "3"]
[1,2,3,[4,5,6]].flatten # => [1, 2, 3, 4, 5, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment