Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.3 KB

quiz.md

File metadata and controls

53 lines (36 loc) · 1.3 KB

Ruby test

What are Sandi Metz' rules?

-[ ] Classes can be no longer than one hundred lines of code. -[ ] Methods can be no longer than five lines of code. -[ ] Pass no more than four parameters into a method. Hash options are parameters. -[ ] Controllers can instantiate only one object.

How do you define a hash in ruby?

-[ ] Hash.new(key: value) -[ ] {key: value} -[ ] {key => value} -[ ] Hash.new().store(:key, value)

Which core Ruby class is this?

-[ ] {name: 'Justin', age: 28}

Which is not part of the Ruby core classes?

-[x] Curses -[ ] Enumerator -[ ] String -[ ] IO -[x] =

Write a method to determine if a given string is a palindrome

Write a program that prints the integers from 1 to 100. But for multiples of three print "Fizz" instead of the number, and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz"

What is the name of the tool used for managing dependencies in Ruby?

-[ ] Bundler

What are external libraries in Ruby called?

-[ ] Gems

What does "monkey patching" mean? -[ ] overriding existing code at a later point to behave differently

What method do you write to build a constructor for a class? -[x] initialize -[ ] construct

What is the way to call a method on an object? -[x] thing.method -[ ] thing->method -[ ] (method(thing()))