First page Back Continue Last page Overview Graphics
Ruby: Nitty-Gritty
Natively OO – even literals are objects
3.times { puts 'Hello!' }
'montclair'.capitalize
(1..5).each {|n| puts „#{n}!“}
/foo/.match 'quux bar foo baz'
[1, 2, 3].size
Single inheritance, 'mixins' for multiple inheritance-like behavior
Variable sigils reflect object orientation
- Whereas Perl sigils represent data type