Created
May 19, 2020 13:28
-
-
Save kouyaf77/642a38b7939e07263be5dfb3bf911f7e to your computer and use it in GitHub Desktop.
polymorphic_good_pattern.rb
This file contains 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
like.likable.execute | |
class Post | |
def execute | |
PostExcutor.call(self) | |
end | |
end | |
class Comment | |
def execute | |
CommentExcutor.call(like) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment