Sha256: 6d2f59b42a495e216bed73fe63b7a5b18b1bbd014e8b5a2a005bafa3c16ab4b7

Contents?: true

Size: 897 Bytes

Versions: 4

Compression:

Stored size: 897 Bytes

Contents

module OData4
  class Service
    class Response
      module Atom
        def parse_entity(entity_xml, entity_options)
          OData4::Entity.from_xml(entity_xml, entity_options)
        end

        def next_page
          result_xml.xpath("/feed/link[@rel='next']").first
        end

        def next_page_url
          next_page.attributes['href'].value.gsub(service.service_url, '')
        end

        def error_message
          result_xml.xpath('//error/message').first.andand.text
        end

        def parsed_body
          result_xml
        end

        private

        def result_xml
          @result_xml ||= ::Nokogiri::XML(response.body).remove_namespaces!
        end

        # Find entity entries in a result set
        #
        # @return [Nokogiri::XML::NodeSet]
        def find_entities
          result_xml.xpath('//entry')
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
odata4-0.9.1 lib/odata4/service/response/atom.rb
odata4-0.9.0 lib/odata4/service/response/atom.rb
odata4-0.8.2 lib/odata4/service/response/atom.rb
odata4-0.8.1 lib/odata4/service/response/atom.rb