Class: Graphiti::Scoping::ExtraAttributes

Inherits:
Base show all
Defined in:
lib/graphiti/scoping/extra_attributes.rb

Instance Attribute Summary

Attributes inherited from Base

#query_hash, #resource

Instance Method Summary collapse

Methods inherited from Base

#apply?, #apply_custom_scope, #apply_standard_scope, #initialize

Constructor Details

This class inherits a constructor from Graphiti::Scoping::Base

Instance Method Details

#applyObject

Loop through all requested extra fields. If custom scoping logic is define for that field, run it. Otherwise, do nothing.

Returns:

  • the scope object we are chaining/modofying



7
8
9
10
11
12
13
# File 'lib/graphiti/scoping/extra_attributes.rb', line 7

def apply
  each_extra_attribute do |callable|
    @scope = callable.call(@scope, resource.context)
  end

  @scope
end