Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.