By applying the access modifier : Public , Private and Protected access Modifier.
Iterator is handled using keyword 'each' in ruby.
then we can use iterator as
number.each do |i|
Above prints the values of an array $no which is accomplished using iterator.
A new scope for a local variable is introduced in the toplevel, a class (module) definition, a method defintion. In a procedure block a new scope is introduced but you can access to a local variable outside the block.
The scope in a block is special because a local variable should be localized in Thread and Proc objects.
Classes,Objects,Inheritance,Singleton methods,polymorphism(accomplished by overriding and overloading) are some oo concepts supported by ruby. Multiple inheritance supported using Mixin concept.