Created
October 30, 2018 18:03
-
-
Save richardpeng/d95387e98b243fc614f673d60eaf0c30 to your computer and use it in GitHub Desktop.
Inherit both class and instance methods from another module with a single include
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
module GraphQL | |
module PunditIntegration | |
module BaseIntegration | |
def self.included(child) | |
child.extend ClassMethods | |
end | |
module ClassMethods | |
def policy_class | |
end | |
end | |
def pundit_role | |
end | |
end | |
module MutationIntegration | |
def self.included(child) | |
child.include GraphQL::PunditIntegration::BaseIntegration | |
child.extend ClassMethods | |
end | |
module ClassMethods | |
end | |
end | |
end | |
end | |
class MyClass | |
include GraphQL::PunditIntegration::MutationIntegration | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment