Module: GraphqlPundit::Common

Included in:
AuthorizationExtension
Defined in:
lib/graphql_pundit/common.rb

Overview

Common methods used for authorization and scopes

Instance Method Summary collapse

Instance Method Details

#callable?(thing) ⇒ Boolean

Returns:



6
7
8
# File 'lib/graphql_pundit/common.rb', line 6

def callable?(thing)
  thing.respond_to?(:call)
end

#model?(thing) ⇒ Boolean

Returns:



10
11
12
# File 'lib/graphql_pundit/common.rb', line 10

def model?(thing)
  thing.respond_to?(:model)
end

#object?(thing) ⇒ Boolean

Returns:



14
15
16
# File 'lib/graphql_pundit/common.rb', line 14

def object?(thing)
  thing.respond_to?(:object)
end