Class: Vertica::Messages::ReadyForQuery

Inherits:
BackendMessage show all
Defined in:
lib/vertica/messages/backend_messages/ready_for_query.rb

Constant Summary collapse

STATUSES =
{
  'I' => :no_transaction,
  'T' => :in_transaction,
  'E' => :failed_transaction
}

Constants inherited from BackendMessage

BackendMessage::MessageIdMap

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BackendMessage

factory, message_id

Methods inherited from Message

message_id, #message_string

Constructor Details

#initialize(data) ⇒ ReadyForQuery

Returns a new instance of ReadyForQuery.



15
16
17
# File 'lib/vertica/messages/backend_messages/ready_for_query.rb', line 15

def initialize(data)
  @transaction_status = STATUSES[data.unpack('a').first]
end

Instance Attribute Details

#transaction_statusObject (readonly)

Returns the value of attribute transaction_status.



13
14
15
# File 'lib/vertica/messages/backend_messages/ready_for_query.rb', line 13

def transaction_status
  @transaction_status
end