Test your proficiency in Ruby. Take other quizzes in Ruby series.
. . . I'd love to hear from you. Please leave your comments. . .
Best of luck!
*** Ary Alva ***
Def my_method(param_all*)
Def my_method(*param_all)
Def my_method(first_param, *param_all)
Def my_method(*first_param, *param_all)
Def my_method(*first_param, param_all*)
Rate this question:
H={:bird=>'fly', :horse=>'gallop', :snake=>'snake'}
:snake.to-s
H={bird:=>'fly', horse:=>'gallop', snake:=>'snake'}
Snake:.to_s
None of the above
Rate this question:
Sound="roar"
@@sound="roar"
@sound="roar"
Puts #{sound}
None of the above
Rate this question:
Animal.to_s
P animal
Puts animal.inspect
None of the above
Rate this question:
Attr @sound, TRUE
Attr :sound, TRUE
Attr_reader :sound
Attr_accessor :sound
Attr_writer :sound
Rate this question:
Puts ::
Puts $$
Puts $:
Puts @@
None of the above
Rate this question:
Enumeratable class doesn't have iterator methods
You can not write your own iterator method
Array class doesn't have iterators methods
Hash class doesn't have iterators methods
All of the above
Rate this question:
Use a semicolon at the end of the first line
Use a backslash at the end of the first line
Break line at an operator like + or - or break after semicolon between method parameters
None of the above
Rate this question:
Class Bird > Animal
Class Bird < Animal
Class Bird extends Animal
Calss Bird
None of the above
Rate this question:
Super is Ruby keyword
Super invokes the method with the same name in the superclass
Super invokes the method with the same name in the Object class
Super can be used outside of the class
None of the above
Rate this question:
To use the code from module Zoo you have to include the statement require 'zoo_file'
To use the code from module Zoo you have to start with the statement "include Zoo"
To use methods defined in the class Animal outside of the file zoo_file all methods from Animal class should be preceeded with Animal::
To avoid prefixing Animal methods with "Zoo::", the statement "include Zoo" should be located anywhere in the code after the statement "require zoo_file" and before methods from Animal class are used
Ruby code can be grouped into modules
Rate this question:
Alias
Alias
#alias
%alias
None of the above
Rate this question:
My_string=
My_string=
My_string=
Size="small" my_string=
None of the above
Rate this question:
A+b if TRUE
A+b if false
True=a+b
A + b if a==true
None of the above
Rate this question:
3_1_4_1_5_9_2_6
3 1 4 1 5 9 2 6
31415926
None of the above
Rate this question:
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.