Class: Gqldb::GqlRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/tina4_ultipa/pb.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gql: "", graph_name: "", parameters: [], session_id: 0, transaction_id: 0, timeout: 0, read_only: false, max_path_results: 0) ⇒ GqlRequest

Returns a new instance of GqlRequest.



353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/tina4_ultipa/pb.rb', line 353

def initialize(gql: "", graph_name: "", parameters: [], session_id: 0,
               transaction_id: 0, timeout: 0, read_only: false,
               max_path_results: 0)
  @gql = gql
  @graph_name = graph_name
  @parameters = parameters
  @session_id = session_id
  @transaction_id = transaction_id
  @timeout = timeout
  @read_only = read_only
  @max_path_results = max_path_results
end

Instance Attribute Details

#gqlObject

Returns the value of attribute gql.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def gql
  @gql
end

#graph_nameObject

Returns the value of attribute graph_name.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def graph_name
  @graph_name
end

#max_path_resultsObject

Returns the value of attribute max_path_results.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def max_path_results
  @max_path_results
end

#parametersObject

Returns the value of attribute parameters.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def parameters
  @parameters
end

#read_onlyObject

Returns the value of attribute read_only.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def read_only
  @read_only
end

#session_idObject

Returns the value of attribute session_id.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def session_id
  @session_id
end

#timeoutObject

Returns the value of attribute timeout.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def timeout
  @timeout
end

#transaction_idObject

Returns the value of attribute transaction_id.



350
351
352
# File 'lib/tina4_ultipa/pb.rb', line 350

def transaction_id
  @transaction_id
end

Class Method Details

.encode(msg) ⇒ Object



366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/tina4_ultipa/pb.rb', line 366

def self.encode(msg)
  buf = "".b
  Wire.write_string(buf, 1, msg.gql)
  Wire.write_string(buf, 2, msg.graph_name)
  msg.parameters.each do |p|
    Wire.write_bytes(buf, 3, Parameter.encode(p))
  end
  Wire.write_varint(buf, 4, msg.session_id)
  Wire.write_varint(buf, 5, msg.transaction_id)
  Wire.write_varint(buf, 6, msg.timeout)
  Wire.write_bool(buf, 7, msg.read_only)
  Wire.write_varint(buf, 8, msg.max_path_results)
  buf
end