Class: ActiveGraph::Core::QueryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/active_graph/core/query_builder.rb

Defined Under Namespace

Classes: Query

Class Method Summary collapse

Class Method Details

.query(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/active_graph/core/query_builder.rb', line 6

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