class HQ::GraphQL::Field
Attributes
Public Class Methods
new(*args, authorize_action: :read, authorize: nil, klass: nil, **options, &block)
click to toggle source
Calls superclass method
# File lib/hq/graphql/field.rb, line 8 def initialize(*args, authorize_action: :read, authorize: nil, klass: nil, **options, &block) super(*args, **options, &block) @authorize_action = authorize_action @authorize = authorize @klass_or_string = klass end
Public Instance Methods
klass()
click to toggle source
# File lib/hq/graphql/field.rb, line 29 def klass @klass ||= @klass_or_string.is_a?(String) ? @klass_or_string.constantize : @klass_or_string end
scope(&block)
click to toggle source
# File lib/hq/graphql/field.rb, line 15 def scope(&block) if block @scope = block else @scope end end