Show:
Questions
Responses
Print
The
Language
Enumerable
Methods
Classes & Modules
Misc
100
nil and false
What are the only two falsey values in ruby?
100
Synonym for map.
What is collect?
100
Keyword used to access the current object.
What is self?
100
Two types of methods found in a class.
Class methods and instance methods.
100
The exception thrown when the wrong number of arguments is passed to a method.
What is ArgumentError?
200
A variable that starts with a capital letter.
What is a constant?
200
The only method you must implement for a class to support the Enumerable module.
What is #each.
200
Method used to programmatically create new methods.
What is define_method?
200
A class defined inside another class.
What is a nested class?
200
The difference between puts and p.
What is puts calls .to_s while p calls .inspect
300
Shovel operator.
What is used to push new members to an array or string?
300
Two classes which mixin the Enumerable module.
What are Array and Set (or Hash or Range or IO)?
300
A method which modifies the internal state of the object receiver?
What is a mutator method?
300
A class with only a single instance
What is a singleton class?
300
The constant used to access environment variables.
What is ENV?
400
Prefix used to declare global variables.
What is $.
400
10 enumerable methods.
What are: inject, each, each_with_index, map, collect, zip, etc...
400
Used to call the same method as defined in the parent class.
What is super.
400
Two ways to declare class methods.
What is self.method_name and self << class def method_name; end
400
The difference between == and .equal?
What is == compares generic comparison (defined as a method) while .equal? compares object identity.
500
Ignoring the class of an object and instead relying on its methods.
What is duck typing?
500
The keyword that make block style interators in Ruby 'work'.
What is yield?
500
Used to call a private method from outside the receiver object.
What is send?
500
The difference between including a module or extending a class with a module. (include Foo vs. extend Foo)
What is extend adds methods in the module as class methods, while include adds module methods as instance methods.
500
The shortest way to construct a string of 1000 'a's.
What is "a"*1000