Class: PostgresPR::DataRow

Inherits:
Message
  • Object
show all
Defined in:
lib/postgres-pr/message.rb

Constant Summary

Constants inherited from Message

Message::MsgTypeMap

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Message

create, #dump, dump, read, register_message_type

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



174
175
176
# File 'lib/postgres-pr/message.rb', line 174

def columns
  @columns
end

Instance Method Details

#parse(buffer) ⇒ Object



176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/postgres-pr/message.rb', line 176

def parse(buffer)
  super do
    n_cols = buffer.read_int16
    @columns = (1..n_cols).collect {
      len = buffer.read_int32 
      if len == -1
        nil
      else
        buffer.read(len)
      end
    }
  end
end