lib/grumlin/middlewares/build_query.rb in grumlin-0.23.0 vs lib/grumlin/middlewares/build_query.rb in grumlin-1.0.0.rc1
- old
+ new
@@ -1,24 +1,20 @@
# frozen_string_literal: true
-module Grumlin
- module Middlewares
- class BuildQuery < Middleware
- def call(env)
- env[:query] = {
- requestId: SecureRandom.uuid,
- op: :bytecode,
- processor: env[:session_id] ? :session : :traversal,
- args: {
- gremlin: {
- :@type => "g:Bytecode",
- :@value => env[:bytecode]
- },
- aliases: { g: :g },
- session: env[:session_id]
- }.compact
- }
- @app.call(env)
- end
- end
+class Grumlin::Middlewares::BuildQuery < Grumlin::Middlewares::Middleware
+ def call(env)
+ env[:query] = {
+ requestId: SecureRandom.uuid,
+ op: :bytecode,
+ processor: env[:session_id] ? :session : :traversal,
+ args: {
+ gremlin: {
+ :@type => "g:Bytecode",
+ :@value => env[:bytecode]
+ },
+ aliases: { g: :g },
+ session: env[:session_id]
+ }.compact
+ }
+ @app.call(env)
end
end