Skip to content

Instantly share code, notes, and snippets.

@etdebruin
Created October 31, 2011 17:43
Show Gist options
  • Save etdebruin/1328122 to your computer and use it in GitHub Desktop.
Save etdebruin/1328122 to your computer and use it in GitHub Desktop.
Interfacing
class Interface
def method_missing(method, *args, &block)
case method.to_s
when 'beaver'
throw 'Method missing'
end
end
def acorn
puts "acorn!"
end
end
class Command < Interface
def beaver
puts "beaver!"
end
end
a = Command.new
a.acorn
a.beaver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment