Skip to content

Instantly share code, notes, and snippets.

@wyodeb
Created July 10, 2024 06:56
Show Gist options
  • Save wyodeb/8026a265b148c1d8dc68c43cf19bd79a to your computer and use it in GitHub Desktop.
Save wyodeb/8026a265b148c1d8dc68c43cf19bd79a to your computer and use it in GitHub Desktop.
class Magician
def method_missing(name, *args)
puts "You tried to call #{name} with these arguments: #{args.join(', ')}"
end
end
magician = Magician.new
magician.cast_spell("fireball", "enemy") # You tried to call cast_spell with these arguments: fireball, enemy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment