Skip to content

Commit

Permalink
* added Connection#notice_processor attribute accessor
Browse files Browse the repository at this point in the history
* 0.3.5
  • Loading branch information
mneumann committed Jan 21, 2005
1 parent 0924ee5 commit 8f747c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/og/test.rb
@@ -1,5 +1,5 @@
$LOAD_PATH.unshift '../../lib'
$LOAD_PATH.unshift '/tmp/og-0.5.0/lib'
require 'rubygems'
require 'og'
require 'glue/logger'

Expand Down
7 changes: 5 additions & 2 deletions lib/postgres-pr/connection.rb
Expand Up @@ -15,6 +15,9 @@ module PostgresPR

class Connection

# A block which is called with the NoticeResponse object as parameter.
attr_accessor :notice_processor

def initialize(database, user, password=nil, uri = nil)
uri ||= DEFAULT_URI

Expand Down Expand Up @@ -51,7 +54,7 @@ def initialize(database, user, password=nil, uri = nil)
when ErrorResponse
raise msg.field_values.join("\t")
when NoticeResponse
# TODO
@notice_processor.call(msg) if @notice_processor
when ParameterStatus
@params[msg.key] = msg.value
when BackendKeyData
Expand Down Expand Up @@ -103,7 +106,7 @@ def query(sql)
# TODO
errors << msg
when NoticeResponse
p msg
@notice_processor.call(msg) if @notice_processor
else
# TODO
end
Expand Down
2 changes: 1 addition & 1 deletion lib/postgres-pr/version.rb
@@ -1,3 +1,3 @@
module PostgresPR
Version = "0.3.4"
Version = "0.3.5"
end

0 comments on commit 8f747c5

Please sign in to comment.