Logo F2FInterview

Ruby Rails Interview Questions

Q   |   QA

class jak

def method1

--------
--------
end

end

obj=jak.new

It is single object
def obj.object_method_one
--------
--------
end

obj.Send(object_method_every)

It will be created every for every object creation 

Something that used in an expression to manipulate objects such as + (plus), - (minus), * (multiply), and / (divide). You can also use operators to do comparisons,such as with <, >, and &&. The priority is based on "BODMAS"
 

for..in
untill..end
while..end
do..end

Note: You can also use each to iterate a array as loop not exactly like loop

Classes,Objects,Inheritance,Singleton methods,polymorphism(accomplished by over riding and overloading) are some oo concepts supported by ruby. Multiple inheritance supported using Mixin concept. 

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.

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: