Sha256: 98fa67f5973623d751772c047a2526b5ccb12fe722a00c398c8b0745dfc243e8

Contents?: true

Size: 1.19 KB

Versions: 189

Compression:

Stored size: 1.19 KB

Contents

module Neo4j::Core
  class Query
    # Creates a Neo4j::ActiveNode::Query::QueryProxy object that builds off of a Core::Query object.
    #
    # @param [Class] model An ActiveNode model to be used as the start of a new QueryuProxy chain
    # @param [Symbol] var The variable to be used to refer to the object from within the new QueryProxy
    # @param [Boolean] optional Indicate whether the new QueryProxy will use MATCH or OPTIONAL MATCH.
    # @return [Neo4j::ActiveNode::Query::QueryProxy] A QueryProxy object.
    def proxy_as(model, var, optional = false)
      # TODO: Discuss whether it's necessary to call `break` on the query or if this should be left to the user.
      Neo4j::ActiveNode::Query::QueryProxy.new(model, nil, node: var, optional: optional, starting_query: self, chain_level: @proxy_chain_level)
    end

    # Calls proxy_as with `optional` set true. This doesn't offer anything different from calling `proxy_as` directly but it may be more readable.
    def proxy_as_optional(model, var)
      proxy_as(model, var, true)
    end

    # For instances where you turn a QueryProxy into a Query and then back to a QueryProxy with `#proxy_as`
    attr_accessor :proxy_chain_level
  end
end

Version data entries

189 entries across 189 versions & 2 rubygems

Version Path
neo4j-8.0.0.rc.3 lib/neo4j/core/query.rb
neo4j-8.0.0.rc.2 lib/neo4j/core/query.rb
neo4j-8.0.0.rc.1 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.12 lib/neo4j/core/query.rb
neo4j-7.2.3 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.11 lib/neo4j/core/query.rb
neo4j-7.2.2 lib/neo4j/core/query.rb
neo4j-7.1.4 lib/neo4j/core/query.rb
neo4j-7.0.16 lib/neo4j/core/query.rb
neo4j-7.2.1 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.10 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.9 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.8 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.7 lib/neo4j/core/query.rb
neo4j_legacy-7.2.0.2 lib/neo4j/core/query.rb
neo4j_legacy-7.2.0.1 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.6 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.5 lib/neo4j/core/query.rb
neo4j-8.0.0.alpha.4 lib/neo4j/core/query.rb
neo4j-7.2.0 lib/neo4j/core/query.rb