class RealPage::DocumentParser::UnitObject

Parse the GetUnitsByProperty response

Private Instance Methods

parse_body(body) click to toggle source

@param body [Hash<String, Object>] the body of the XML response parsed

into a Hash

@return [Array<RealPage::Model::Unit>] the units contained in the

response

@raise [RealPage::Error::Base] if the response is invalid

# File lib/real_page/document_parser/unit_object.rb, line 16
def parse_body(body)
  Utils::ArrayFetcher.new(
    hash: units(body),
    key: 'UnitObject',
    model: Model::Unit
  ).fetch
end
units(body) click to toggle source
# File lib/real_page/document_parser/unit_object.rb, line 24
def units(body)
  result = body['getunitsbypropertyResponse']['getunitsbypropertyResult']
  result['GetUnitsByProperty']
end