ABSTRACT

Yukihiro Matsumoto (Matz) designed Ruby in the mid-1990s as a language in which one could be productive and have fun programming. Rather than building a language with a small, simple core, Matz looked to be pragmatic, and aimed for human-friendliness. This chapter focuses on object-oriented paradigm and examines how Ruby makes object-oriented programming not only possible but natural. It discusses two important features of Ruby: blocks and mixins. The chapter then examines access control, a feature Ruby makes relatively easy compared to the four languages such as, JavaScript, CoffeeScript, Lua, and Python. Ruby features a large number of built-in classes. Like Python, Ruby classifies floating point numbers differently than integers, but unlike Python, it classifies smaller integers differently than bigger ones. Every method in Ruby may be passed, in addition to its arguments, a block. Block parameters have their own scope and shadow variables of the same name in enclosing scopes.