Sha256: fd4c0aa5dec74877eed68c6aec3815aed3a34d9ff0825d65fe5c645709ec03b5
Contents?: true
Size: 690 Bytes
Versions: 152
Compression:
Stored size: 690 Bytes
Contents
module Graphiti class Scoping::ExtraAttributes < Scoping::Base # Loop through all requested extra fields. If custom scoping # logic is define for that field, run it. Otherwise, do nothing. # # @return the scope object we are chaining/modofying def apply each_extra_attribute do |callable| @scope = callable.call(@scope, resource.context) end @scope end private def each_extra_field resource.extra_fields.each_pair do |name, callable| if extra_fields.include?(name) yield callable end end end def extra_fields query_hash[:extra_fields][resource.type] || [] end end end
Version data entries
152 entries across 152 versions & 2 rubygems