Skip to content

Instantly share code, notes, and snippets.

@1a57danc3
Created August 31, 2018 15:21
Show Gist options
  • Save 1a57danc3/60377682debb8fdb7c63f89949c500a7 to your computer and use it in GitHub Desktop.
Save 1a57danc3/60377682debb8fdb7c63f89949c500a7 to your computer and use it in GitHub Desktop.
Ruby Cheatsheet

Ruby Cheatsheet

Looping

  1. .times: execute block x number of times - Ex: 5.times { puts "executed" }

If

  1. execute if true statements can be added to the end of a line: puts "true" if true

Arrays

  1. Initialize with size and block: Array.new(2) { 2 * 2 } = [4, 4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment