Skip to content

Instantly share code, notes, and snippets.

@audy
Created May 12, 2020 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audy/c8bf7f7f7248f67524915720d1f006cc to your computer and use it in GitHub Desktop.
Save audy/c8bf7f7f7248f67524915720d1f006cc to your computer and use it in GitHub Desktop.
class BaseKitty
def meow
nil
end
end
class Nancy < BaseKitty
def meow
(super || "shshsh")
end
end
class SqueekKitty < BaseKitty
def meow
(super || "squeeeek")
end
end
class KittyMeowEnhander
def meow
["meow", "meow", "meowoowowow!!!"]
end
end
class MagicKitty < BaseKitty
include KittyMeowEnhancer
end
nancy = Nancy.new
squeeko = SqueekKitty.new
magic = SuperKitty.new
p nancy.meow
p squeeko.meow
p magic.meow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment