class CypherBuilder::Adapter::Neography

Public Class Methods

new(neo = ::Neography::Rest.new) click to toggle source
# File lib/cypher_builder/adapter/neography.rb, line 2
def initialize(neo = ::Neography::Rest.new)
  @neo = neo
end

Public Instance Methods

execute(query, params) click to toggle source

@param query [#to_s] @param params [#to_h] @return [Array<Hash{Symbol => Object}>]

# File lib/cypher_builder/adapter/neography.rb, line 9
def execute(query, params)
  result = @neo.execute_query(query.to_s, params.to_h)
  columns = result['columns'].map { |it| it.to_sym }
  data = result['data']
  data.map { |values| columns.zip(values).to_h }
end