Class: MysqlPR::Protocol::PrepareResultPacket
- Inherits:
-
Object
- Object
- MysqlPR::Protocol::PrepareResultPacket
- Defined in:
- lib/mysql-pr/protocol.rb
Overview
Prepare result packet
Instance Attribute Summary collapse
-
#field_count ⇒ Object
readonly
Returns the value of attribute field_count.
-
#param_count ⇒ Object
readonly
Returns the value of attribute param_count.
-
#statement_id ⇒ Object
readonly
Returns the value of attribute statement_id.
-
#warning_count ⇒ Object
readonly
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.
686 687 688 |
# File 'lib/mysql-pr/protocol.rb', line 686 def initialize(*args) @statement_id, @field_count, @param_count, @warning_count = args end |
Instance Attribute Details
#field_count ⇒ Object (readonly)
Returns the value of attribute field_count.
684 685 686 |
# File 'lib/mysql-pr/protocol.rb', line 684 def field_count @field_count end |
#param_count ⇒ Object (readonly)
Returns the value of attribute param_count.
684 685 686 |
# File 'lib/mysql-pr/protocol.rb', line 684 def param_count @param_count end |
#statement_id ⇒ Object (readonly)
Returns the value of attribute statement_id.
684 685 686 |
# File 'lib/mysql-pr/protocol.rb', line 684 def statement_id @statement_id end |
#warning_count ⇒ Object (readonly)
Returns the value of attribute warning_count.
684 685 686 |
# File 'lib/mysql-pr/protocol.rb', line 684 def warning_count @warning_count end |
Class Method Details
.parse(pkt) ⇒ Object
673 674 675 676 677 678 679 680 681 682 |
# File 'lib/mysql-pr/protocol.rb', line 673 def self.parse(pkt) raise ProtocolError, "invalid packet" unless pkt.utiny == 0 statement_id = pkt.ulong field_count = pkt.ushort param_count = pkt.ushort f = pkt.utiny warning_count = pkt.ushort raise ProtocolError, "invalid packet" unless f == 0x00 self.new statement_id, field_count, param_count, warning_count end |