CSE 341 -- Ruby
Running Ruby
Running Ruby - Quickstart
(probably all you need). You could also look at the
detailed instructions from Winter 2015
if you need additional help, although some links may be obsolete.
tutorial on Ruby mode for emacs
Ruby Introduction
pptx
pdf
lecture summary
PosRational.rb
Blocks and Procs
pptx
pdf
lecture summary
blocks_inheritance.rb
block_proc.rb
(converting between blocks and procs)
Inheritance and Mixins
pptx
pdf
mixins.rb
(examples of mixins). Also see the Ruby documentation for
Comparable
and
Emumerable
.
self_super.rb
(self and super, including mixins)
For comparison with other languages (not for the faint-of-heart):
Multiple inheritance: see
Multiple Inheritance in Python
, and also the
Python 2.3 Method Resolution Order
Metaclasses (especially in Smalltalk-80):
Wikipedia article on metaclasses
Coercing Numeric Types
mycomplex.rb
(useful for Assignment 8)
Reflection
Reflection
octopus.rb
(example class)
Unit testing in Ruby:
PosRationalTester.rb
. Unit testing gem:
minitest
Mini-Exercises
Ruby Mini-exercises #1
;
solution
External Links
Ruby home page
(includes downloads)
Ruby in 20 minutes
(quick overview)
Ruby API documentation
Programming Ruby
(first 8 chapters of the first edition of the suggested Ruby textbook)