Class: Graphiti::Scoping::ExtraAttributes

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

Instance Method Summary collapse

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