Ruby Data Types

Learning Goals

  • Explain the key points of each of the important basic Ruby data types.
  • Be able to reference Ruby Docs in order to determine what an object’s method does.
  • Speak to a few common methods for each data type.

Structure

5 min - Warm up / Move to groups 20 min - Ruby Docs Overview / Task overview 5 min - Break 25 min - Work in Groups 5 min - Break 25 min - Presentations 5 min - Break 25 min - Instructor Recap

Key Points - Strings

  • Any text in quotes.
  • Double quotes or single quotes so long as they match.
  • Some key methods, length, chars, upcase, downcase, capitalize, []

Key Points - Arrays

  • Ordered list
  • Holds many things.
  • Can hold nothing
  • Key methods - length, join, push, pop, []
  • Indexed

Key Points - Hashes

  • Also known as a dictionary
  • It has a key and value setup
  • Key methods - values, keys, []

Additional Resources