Working with class fields in Ruby.

OOP in this Ruby of yours is quite different from OOP in our proletarian php =). For example, let's take something as trivial as class fields. Despite the fact that methods are encapsulated, fields are not. (In other words, access modifiers cannot be applied to fields). All fields are protected.

Ruby programming language

Ruby - is a programming language with complex, but expressive grammar and a basic class library with a rich and powerful API. Ruby incorporates features from languages such as Lisp, Perl, and Smalltalk, and uses a grammar that programmers familiar with C and Java languages can learn. Ruby is a fully object-oriented language, but it also supports procedural and functional programming styles.