Class: Mysql::Protocol::ResultPacket
- Defined in:
- lib/mysql/protocol.rb
Overview
Result packet
Instance Attribute Summary collapse
-
#affected_rows ⇒ Object
Returns the value of attribute affected_rows.
-
#field_count ⇒ Object
Returns the value of attribute field_count.
-
#insert_id ⇒ Object
Returns the value of attribute insert_id.
-
#message ⇒ Object
Returns the value of attribute message.
-
#server_status ⇒ Object
Returns the value of attribute server_status.
-
#warning_count ⇒ Object
Returns the value of attribute warning_count.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ ResultPacket
constructor
A new instance of ResultPacket.
Constructor Details
#initialize(*args) ⇒ ResultPacket
Returns a new instance of ResultPacket.
423 424 425 |
# File 'lib/mysql/protocol.rb', line 423 def initialize(*args) @field_count, @affected_rows, @insert_id, @server_status, @warning_count, @message = args end |
Instance Attribute Details
#affected_rows ⇒ Object
Returns the value of attribute affected_rows.
421 422 423 |
# File 'lib/mysql/protocol.rb', line 421 def affected_rows @affected_rows end |
#field_count ⇒ Object
Returns the value of attribute field_count.
421 422 423 |
# File 'lib/mysql/protocol.rb', line 421 def field_count @field_count end |
#insert_id ⇒ Object
Returns the value of attribute insert_id.
421 422 423 |
# File 'lib/mysql/protocol.rb', line 421 def insert_id @insert_id end |
#message ⇒ Object
Returns the value of attribute message.
421 422 423 |
# File 'lib/mysql/protocol.rb', line 421 def @message end |
#server_status ⇒ Object
Returns the value of attribute server_status.
421 422 423 |
# File 'lib/mysql/protocol.rb', line 421 def server_status @server_status end |
#warning_count ⇒ Object
Returns the value of attribute warning_count.
421 422 423 |
# File 'lib/mysql/protocol.rb', line 421 def warning_count @warning_count end |
Class Method Details
.parse(data) ⇒ Object
409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/mysql/protocol.rb', line 409 def self.parse(data) field_count = Protocol.lcb2int! data if field_count == 0 affected_rows = Protocol.lcb2int! data insert_id = Protocol.lcb2int!(data) server_status, warning_count, = data.unpack("vva*") return self.new(field_count, affected_rows, insert_id, server_status, warning_count, ) else return self.new(field_count) end end |