OO in Ruby Flashcards
In general, how do you declare a class and it’s methods?
In general, what are initializers and how do they work?
In general, how does more than one intializer work in Ruby?
What is raise in Ruby?
How does the array work with calling an intializer/constructor
In general, how would a class look with multiple arguments for the intializer?
In general, how do you use default values in Ruby initializers
How does overloading work in Ruby?
By default, what protection is data members and methods?
What is the shorthand for writing simple accessors and mutators?
how does to_s workin Ruby?
How do you make an instance in Ruby?
In general how do you invoke methods in Ruby?
How does yield work in Ruby?
How do you pass parameters to and from a code block to be used with yield?
What is the difference between (double-dots).. and (triple-dots)… in Ruby?
How do you pass multiple parameters in a code block in Ruby?
What would this code block output?
9
Explain how for loops are blocks
In the following code, what data members exist before the initializer is run
In general, how does ruby find the correct inherrited method?
With regard to inheritance, how do initializers work? How do you call the super initializer, when is it done by default, when is it not done?
For the following code, if we made super( ) the last statement in B’s initializer, what would the output be?
Explain in detail, what is happening the code below (shadowing/overriding)
In general how does Method refinement work in Ruby?