Sha256: f8c0d5b132e4cc5d3d4e47a49b1439ec03264e9bf0cb38494809ea916b8ebc12

Contents?: true

Size: 871 Bytes

Versions: 92

Compression:

Stored size: 871 Bytes

Contents

module Neo4j::Shared
  module Cypher
    module CreateMethod
      def create_method
        creates_unique? ? :create_unique : :create
      end

      def creates_unique(option = :none)
        option = :none if option == true
        @creates_unique = option
      end

      def creates_unique_option
        @creates_unique || :none
      end

      def creates_unique?
        !!@creates_unique
      end
      alias unique? creates_unique?
    end

    module RelIdentifiers
      extend ActiveSupport::Concern

      [:from_node, :to_node, :rel].each do |element|
        define_method("#{element}_identifier") do
          instance_variable_get(:"@#{element}_identifier") || element
        end

        define_method("#{element}_identifier=") do |id|
          instance_variable_set(:"@#{element}_identifier", id.to_sym)
        end
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 2 rubygems

Version Path
neo4j-9.6.2 lib/neo4j/shared/cypher.rb
activegraph-10.0.0.pre.alpha.11 lib/neo4j/shared/cypher.rb
activegraph-10.0.0.pre.alpha.10 lib/neo4j/shared/cypher.rb
activegraph-10.0.0.pre.alpha.9 lib/neo4j/shared/cypher.rb
activegraph-10.0.0.pre.alpha.8 lib/neo4j/shared/cypher.rb
activegraph-10.0.0.pre.alpha.7 lib/neo4j/shared/cypher.rb
activegraph-10.0.0.pre.alpha.6 lib/neo4j/shared/cypher.rb
neo4j-10.0.0.pre.alpha.5 lib/neo4j/shared/cypher.rb
neo4j-10.0.0.pre.alpha.4 lib/neo4j/shared/cypher.rb
neo4j-10.0.0.pre.alpha.3 lib/neo4j/shared/cypher.rb
neo4j-10.0.0.pre.alpha.2 lib/neo4j/shared/cypher.rb
neo4j-10.0.0.pre.alpha.1 lib/neo4j/shared/cypher.rb
neo4j-9.6.1 lib/neo4j/shared/cypher.rb
neo4j-9.6.0 lib/neo4j/shared/cypher.rb
neo4j-9.5.3 lib/neo4j/shared/cypher.rb
neo4j-9.5.2 lib/neo4j/shared/cypher.rb
neo4j-9.5.0 lib/neo4j/shared/cypher.rb
neo4j-9.4.0 lib/neo4j/shared/cypher.rb
neo4j-9.3.0 lib/neo4j/shared/cypher.rb
neo4j-9.2.4 lib/neo4j/shared/cypher.rb