Module: PostgresPR::NoticeErrorMixin

Included in:
ErrorResponse, NoticeResponse
Defined in:
lib/postgres-pr/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#field_valuesObject (readonly)

Returns the value of attribute field_values.



207
208
209
# File 'lib/postgres-pr/message.rb', line 207

def field_values
  @field_values
end

Instance Method Details

#parse(buffer) ⇒ Object



209
210
211
212
213
214
215
216
217
218
219
# File 'lib/postgres-pr/message.rb', line 209

def parse(buffer)
  super do
    break if buffer.read_byte == 0
    @field_values = []
    while buffer.position < buffer.size-1
      @field_values << buffer.read_cstring
    end
    terminator = buffer.read_byte
    raise ParseError unless terminator == 0
  end
end