module CypherBuilder::Resolver

Public Instance Methods

resolve(parts, format: '%s', separator: ' ', ** opts) click to toggle source
# File lib/cypher_builder/infra/resolver.rb, line 14
def resolve(parts, format: '%s', separator: ' ', ** opts)
  Array(parts).map do |p|
    sprintf(format, p.as_cypher(** opts))
  end.join(separator).strip
end
wrap(*values) click to toggle source
# File lib/cypher_builder/infra/resolver.rb, line 2
def wrap(*values)
  values.map do |v|
    if v.respond_to?(:as_cypher)
      v
    elsif Symbol === v
      AsIs.new(v)
    else
      Literal.new(v)
    end
  end
end