Sha256: 095dc1f8ba3f0452ad5366be425308320af3baccbc621b0dd69f9487f63b5325

Contents?: true

Size: 474 Bytes

Versions: 25

Compression:

Stored size: 474 Bytes

Contents

module ActiveGraph
  module Core
    class QueryBuilder
      Query = Struct.new(:cypher, :parameters, :pretty_cypher, :context)

      def self.query(*args)
        case args.map(&:class)
        when [String], [String, Hash]
          Query.new(args[0], args[1] || {})
        when [::ActiveGraph::Core::Query]
          args[0]
        else
          fail ArgumentError, "Could not determine query from arguments: #{args.inspect}"
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
activegraph-11.0.0-java lib/active_graph/core/query_builder.rb
activegraph-11.0.0.beta.4-java lib/active_graph/core/query_builder.rb
activegraph-11.0.0.beta.3-java lib/active_graph/core/query_builder.rb
activegraph-11.0.0.beta.2-java lib/active_graph/core/query_builder.rb
activegraph-11.0.0.beta.1-java lib/active_graph/core/query_builder.rb