Skip to content

Instantly share code, notes, and snippets.

@makaroni4
Created March 24, 2014 13:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save makaroni4/9740109 to your computer and use it in GitHub Desktop.
Ruby Quiz questions
# Reddit thread: http://www.reddit.com/r/ruby/comments/217yvm/trivia_ruby_quiz/
# Quiz page: http://makaroni4.com/ruby/quiz/2014/03/24/ruby-quiz/
# Explanation link: http://www.medihack.org/2011/03/15/intend-to-extend/
# Code example:
module Human
def eat
puts "Yam"
end
end
class Robocop
def shoot
end
end
class User
extend Human
end
User.eat # => Yam
class User
extend Human
extend Robocop
end
# => wrong argument type Class (expected Module)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment