Class: RETS4R::Client::ResponseParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rets4r/client/parsers/response_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse_count(xml) ⇒ Object


15
16
17
# File 'lib/rets4r/client/parsers/response_parser.rb', line 15

def parse_count(xml)
  ResponseDocument::Base.safe_parse(xml).validate!.parse_count
end

#parse_key_value(xml) ⇒ Object


6
7
8
# File 'lib/rets4r/client/parsers/response_parser.rb', line 6

def parse_key_value(xml)
  ResponseDocument::Base.safe_parse(xml).validate!.parse_key_value
end

#parse_metadata(xml, format) ⇒ Object


19
20
21
# File 'lib/rets4r/client/parsers/response_parser.rb', line 19

def (xml, format)
  ResponseDocument::Base.safe_parse(xml).validate!.to_rexml
end

#parse_object_response(xml) ⇒ Object


23
24
25
# File 'lib/rets4r/client/parsers/response_parser.rb', line 23

def parse_object_response(xml)
  ResponseDocument::Base.safe_parse(xml).validate!.to_transaction
end

#parse_results(xml, format) ⇒ Object


10
11
12
13
# File 'lib/rets4r/client/parsers/response_parser.rb', line 10

def parse_results(xml, format)
  raise "Invalid format #{format}" unless %w(COMPACT COMPACT-DECODED).include? format
  ResponseDocument::Search.safe_parse(xml).validate!.to_transaction
end