module GraphQL::Pundit::Common

Common methods used for authorization and scopes

Public Class Methods

included(base) click to toggle source
# File lib/graphql-pundit/common.rb, line 16
def self.included(base)
  @current_user = :current_user
  base.extend(ClassMethods)
end

Public Instance Methods

callable?(thing) click to toggle source
# File lib/graphql-pundit/common.rb, line 21
def callable?(thing)
  thing.respond_to?(:call)
end
model?(thing) click to toggle source
# File lib/graphql-pundit/common.rb, line 25
def model?(thing)
  thing.respond_to?(:model)
end
object?(thing) click to toggle source
# File lib/graphql-pundit/common.rb, line 29
def object?(thing)
  thing.respond_to?(:object)
end