Class: Mysql::Protocol::PrepareResultPacket
- Defined in:
- lib/mysql/protocol.rb
Overview
Prepare result packet
Instance Attribute Summary collapse
-
#field_count ⇒ Object
Returns the value of attribute field_count.
-
#param_count ⇒ Object
Returns the value of attribute param_count.
-
#statement_id ⇒ Object
Returns the value of attribute statement_id.
-
#warning_count ⇒ Object
Returns the value of attribute warning_count.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ PrepareResultPacket
constructor
A new instance of PrepareResultPacket.
Constructor Details
#initialize(*args) ⇒ PrepareResultPacket
Returns a new instance of PrepareResultPacket.
474 475 476 |
# File 'lib/mysql/protocol.rb', line 474 def initialize(*args) @statement_id, @field_count, @param_count, @warning_count = args end |
Instance Attribute Details
#field_count ⇒ Object
Returns the value of attribute field_count.
472 473 474 |
# File 'lib/mysql/protocol.rb', line 472 def field_count @field_count end |
#param_count ⇒ Object
Returns the value of attribute param_count.
472 473 474 |
# File 'lib/mysql/protocol.rb', line 472 def param_count @param_count end |
#statement_id ⇒ Object
Returns the value of attribute statement_id.
472 473 474 |
# File 'lib/mysql/protocol.rb', line 472 def statement_id @statement_id end |
#warning_count ⇒ Object
Returns the value of attribute warning_count.
472 473 474 |
# File 'lib/mysql/protocol.rb', line 472 def warning_count @warning_count end |
Class Method Details
.parse(data) ⇒ Object
465 466 467 468 469 470 |
# File 'lib/mysql/protocol.rb', line 465 def self.parse(data) raise ProtocolError, "invalid packet" unless data.slice!(0) == ?\0 statement_id, field_count, param_count, f, warning_count = data.unpack("VvvCv") raise ProtocolError, "invalid packet" unless f == 0x00 self.new statement_id, field_count, param_count, warning_count end |