Created
September 21, 2013 05:37
-
-
Save we4tech/6647543 to your computer and use it in GitHub Desktop.
Pasta in ruby mixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AmericanStyle | |
extend ActiveSupport::Concern | |
included do | |
has_many :american_ingredients | |
end | |
module ClassMethods | |
def macaroni_cheese; ... end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ItalianStyle | |
extend ActiveSupport::Concern | |
included do | |
has_many :italia_ingredients | |
end | |
module ClassMethods | |
def alfredo; ... end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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