Class: PostgresPR::Query

Inherits:
Message show all
Defined in:
lib/postgres-pr/message.rb

Constant Summary

Constants inherited from Message

Message::MsgTypeMap

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Message

create, dump, #parse, read, register_message_type

Constructor Details

#initialize(query) ⇒ Query

:nocov:



243
244
245
# File 'lib/postgres-pr/message.rb', line 243

def initialize(query)
  @query = String.new(query).force_encoding('BINARY')
end

Instance Attribute Details

#queryObject

Returns the value of attribute query.



234
235
236
# File 'lib/postgres-pr/message.rb', line 234

def query
  @query
end

Instance Method Details

#dumpObject



248
249
250
251
252
# File 'lib/postgres-pr/message.rb', line 248

def dump
  super(@query.size + 1) do |buffer|
    buffer.write_cstring(@query)
  end
end