Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Ruby Quiz questions

View Question_4.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# 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
Something went wrong with that request. Please try again.