Sha256: 06d44c6d23b2ed0feb2253cd772f9caa80539e9198fb6ba5832e59f29a164536
Contents?: true
Size: 667 Bytes
Versions: 1
Compression:
Stored size: 667 Bytes
Contents
module Neoon module Cypher class Handler attr_reader :query, :args def initialize(hash) @query = hash[:query] @args = hash[:args] end def to_cypher if query.is_a?(Array) query.map { |q| q.gsub(/\s+/, ' ').strip } else query.gsub(/\s+/, ' ').strip end end def run if query.is_a?(Array) query.each { |q| make_cypher_request(q, args) } else make_cypher_request(query, args) end end protected def make_cypher_request(query, args = nil) Neoon.db.cypher(query, args) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
neoon-0.0.4 | lib/neoon/cypher/handler.rb |