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-12.0.0.beta.4 lib/active_graph/core/query_builder.rb
activegraph-11.5.0.beta.3 lib/active_graph/core/query_builder.rb
activegraph-12.0.0.beta.3 lib/active_graph/core/query_builder.rb
activegraph-12.0.0.beta.2 lib/active_graph/core/query_builder.rb
activegraph-11.5.0.beta.2 lib/active_graph/core/query_builder.rb
activegraph-12.0.0.beta.1 lib/active_graph/core/query_builder.rb
activegraph-11.5.0.beta.1 lib/active_graph/core/query_builder.rb
activegraph-11.5.0.alpha.1 lib/active_graph/core/query_builder.rb
activegraph-11.4.0 lib/active_graph/core/query_builder.rb
activegraph-11.3.1 lib/active_graph/core/query_builder.rb
activegraph-11.3.0 lib/active_graph/core/query_builder.rb
activegraph-11.2.0 lib/active_graph/core/query_builder.rb
activegraph-11.1.0 lib/active_graph/core/query_builder.rb
activegraph-11.1.0.beta.1 lib/active_graph/core/query_builder.rb
activegraph-11.1.0.alpha.4 lib/active_graph/core/query_builder.rb
activegraph-11.1.0.alpha.3 lib/active_graph/core/query_builder.rb
activegraph-11.1.0.alpha.2 lib/active_graph/core/query_builder.rb
activegraph-11.1.0.alpha.1 lib/active_graph/core/query_builder.rb
activegraph-11.0.2-java lib/active_graph/core/query_builder.rb
activegraph-11.0.1-java lib/active_graph/core/query_builder.rb