Class: MysqlPR::Protocol::FieldPacket
- Inherits:
-
Object
- Object
- MysqlPR::Protocol::FieldPacket
- Defined in:
- lib/mysql-pr/protocol.rb
Overview
Field packet
Instance Attribute Summary collapse
-
#charsetnr ⇒ Object
readonly
Returns the value of attribute charsetnr.
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#decimals ⇒ Object
readonly
Returns the value of attribute decimals.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#org_name ⇒ Object
readonly
Returns the value of attribute org_name.
-
#org_table ⇒ Object
readonly
Returns the value of attribute org_table.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ FieldPacket
constructor
A new instance of FieldPacket.
Constructor Details
#initialize(*args) ⇒ FieldPacket
Returns a new instance of FieldPacket.
666 667 668 |
# File 'lib/mysql-pr/protocol.rb', line 666 def initialize(*args) @db, @table, @org_table, @name, @org_name, @charsetnr, @length, @type, @flags, @decimals, @default = args end |
Instance Attribute Details
#charsetnr ⇒ Object (readonly)
Returns the value of attribute charsetnr.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def charsetnr @charsetnr end |
#db ⇒ Object (readonly)
Returns the value of attribute db.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def db @db end |
#decimals ⇒ Object (readonly)
Returns the value of attribute decimals.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def decimals @decimals end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def default @default end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def flags @flags end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def length @length end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def name @name end |
#org_name ⇒ Object (readonly)
Returns the value of attribute org_name.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def org_name @org_name end |
#org_table ⇒ Object (readonly)
Returns the value of attribute org_table.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def org_table @org_table end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def table @table end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
664 665 666 |
# File 'lib/mysql-pr/protocol.rb', line 664 def type @type end |
Class Method Details
.parse(pkt) ⇒ Object
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
# File 'lib/mysql-pr/protocol.rb', line 644 def self.parse(pkt) first = pkt.lcs db = pkt.lcs table = pkt.lcs org_table = pkt.lcs name = pkt.lcs org_name = pkt.lcs f0 = pkt.utiny charsetnr = pkt.ushort length = pkt.ulong type = pkt.utiny flags = pkt.ushort decimals = pkt.utiny f1 = pkt.ushort raise ProtocolError, "invalid packet: f1=#{f1}" unless f1 == 0 default = pkt.lcs return self.new(db, table, org_table, name, org_name, charsetnr, length, type, flags, decimals, default) end |