lucene/client/ruby/solrb/lib/solr/response/ping.rb

21 lines
361 B
Ruby
Raw Normal View History

require 'rexml/xpath'
module Solr
module Response
class Ping < Solr::Response::Xml
def initialize(xml)
super(xml)
@ok = REXML::XPath.first(@doc, './solr/ping') ? true : false
end
# returns true or false depending on whether the ping
# was successful or not
def ok?
@ok
end
end
end
end