lib/odata/service.rb
def read_metadata
      response = nil
      # From file, good for debugging
      if options[:metadata_file]
        data = File.read(options[:metadata_file])
        ::Nokogiri::XML(data).remove_namespaces!
      else # From a URL
        METADATA_TIMEOUTS.each do |timeout|
          response = ::Typhoeus::Request.get(URI.escape("#{service_url}/$metadata"),
                                             options[:typhoeus].merge(timeout: timeout))
          break unless response.timed_out?
        end
        raise "Metadata Timeout" if response.timed_out?
        validate_response(response)
        ::Nokogiri::XML(response.body).remove_namespaces!
      end
    end
# The OData Service's URL
The OData Service's URL
The OData Service ' s URL
def read_metadata
      response = nil
      if options[:metadata_file]
        data = File.read(options[:metadata_file])
        ::Nokogiri::XML(data).remove_namespaces!
      else 
        METADATA_TIMEOUTS.each do |timeout|
          response = ::Typhoeus::Request.get(URI.escape("#{service_url}/$metadata"),
                                             options[:typhoeus].merge(timeout: timeout))
          break unless response.timed_out?
        end
        raise "Metadata Timeout" if response.timed_out?
        validate_response(response)
        ::Nokogiri::XML(response.body).remove_namespaces!
      end
    end
def read_metadata response = nil if options [ :metadata_file ] data = File . read ( options [ :metadata_file ] ) :: Nokogiri :: XML ( data ) . remove_namespaces! else METADATA_TIMEOUTS . each do | timeout | response = :: Typhoeus :: Request . get ( URI . escape ( "#{service_url}/$metadata" ) , options [ :typhoeus ] . merge ( timeout : timeout ) ) break unless response . timed_out? end raise "Metadata Timeout" if response . timed_out? validate_response ( response ) :: Nokogiri :: XML ( response . body ) . remove_namespaces! end end
The OData Service's URL
The OData Service ' s URL
# From file, good for debugging # From a URL