class PGPool::Response

class: Response

Constants

AUTH
BACKEND
CONN
EOF
ERROR_MESSAGES
HOST
INVAL
NOCONN
NOMEM
OK
READ
SOCK
TIMEOUT
UNKNOWN
WRITE

Attributes

node_info[R]
status[R]

Public Class Methods

new(node_id, command) click to toggle source
# File lib/pgpool/response.rb, line 41
def initialize(node_id, command)
  @status    = command.exitstatus
  @node_info = success? ? NodeInfo.build_from_raw_data(node_id, command.stdout) : command.stderr

  self
end

Public Instance Methods

error?() click to toggle source
# File lib/pgpool/response.rb, line 52
def error?
  status != OK
end
error_message() click to toggle source
# File lib/pgpool/response.rb, line 56
def error_message
  ERROR_MESSAGES[@status]
end
inspect() click to toggle source
# File lib/pgpool/response.rb, line 64
def inspect
  to_hash.inspect
end
success?() click to toggle source
# File lib/pgpool/response.rb, line 48
def success?
  status == OK
end
to_hash() click to toggle source
# File lib/pgpool/response.rb, line 60
def to_hash
  { status: @status, node_info: @node_info }
end
to_s() click to toggle source
# File lib/pgpool/response.rb, line 68
def to_s
  "#{inspect}"
end