Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created May 28, 2009 02:56
Show Gist options
  • Save patmaddox/119061 to your computer and use it in GitHub Desktop.
Save patmaddox/119061 to your computer and use it in GitHub Desktop.
# This comes from GenericWebLibrary
class BaseComponent
end
# This comes from RestExtensionLibrary
class RestComponent < BaseComponent
end
# In a language with mixins you could do
module SomeFilterStuff
def login_required; end
end
class MyBaseComponent < BaseComponent
include SomeFilterStuff
end
class MyRestComponent < RestComponent
include SomeFilterStuff
end
# without mixins what do you do?! My solution is
class BaseComponent
def login_required; end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment