Skip to content

Instantly share code, notes, and snippets.

@we4tech
Created September 21, 2013 05:37
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 we4tech/6647543 to your computer and use it in GitHub Desktop.
Save we4tech/6647543 to your computer and use it in GitHub Desktop.
Pasta in ruby mixin
module AmericanStyle
extend ActiveSupport::Concern
included do
has_many :american_ingredients
end
module ClassMethods
def macaroni_cheese; ... end
end
end
module ItalianStyle
extend ActiveSupport::Concern
included do
has_many :italia_ingredients
end
module ClassMethods
def alfredo; ... end
end
end
class Pasta
include ItalianStyle
include AmericanStyle
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment