Sha256: 089b75fa2eec54d6ae3a060704a5a5aab14f75c3ff91b09022e6a985386fdf6c
Contents?: true
Size: 831 Bytes
Versions: 65
Compression:
Stored size: 831 Bytes
Contents
module Graphiti module Util # @api private class Sideload # Determine the namespace for the sideload # # In other words, given a query like # /things?include=a.b # # When 'a' is sideloading 'b', b's namespace is 'b'. # # However, consider a recursive tree structure: # # /things?include=children.children # # The first occurrance of "children" will have the namespace # "children", the second will be "children.children" and so forth. # # This is used to match up other criteria in the query: # # ?filter[children.children][a]=b # # @api private def self.namespace(a, b) if a.to_s.split('.')[0] == b.to_s :"#{a}.#{b}" else b end end end end end
Version data entries
65 entries across 65 versions & 2 rubygems