Posted over 5 years ago. Visible to the public.

Ruby basics [2d]

Ruby is the programming language we use almost exclusively.


  • Be able to read and write simple Ruby programs.
  • Gain an understanding of the following concepts:
    • Basic datatypes: Strings, Numbers, Booleans, Arrays, Hashes
    • Basic language constructs: if, each, case, break...
    • Regular expressions
    • Functions: def, return
    • Errors and raise
    • Object orientation
      • Classes
      • Class methods vs instance methods (def self.method vs. def method)
      • Inheritance
      • Modules and include
    • Code blocks
    • Input and Output
  • Know where to find documentation for Ruby's standard library.


Look at these


  • Reference for Ruby standard libraries
  • DevDocs combines multiple API documentations in a fast, organized, and searchable interface


Word count

Write a small ruby programm cw that accepts a filename, counts the number of
words, lines and paragraphs, and outputs the result.


  • Find out about ARGV.
  • Look up File on apidock.
  • Learn about regular expressions.


Give Array a new method .random_each, that loops randomly through the entries.
I want to be able to say

[1, 2, 3, 4, 5].random_each do |value| puts value end

And get

4 2 1 5 3


Owner of this card:

Henning Koch
Last edit:
26 days ago
by Henning Koch
Posted by Henning Koch to makandra Curriculum
This website uses short-lived cookies to improve usability.
Accept or learn more