lib/aleph/connection.rb
def x_request(func, params)
      url = "#{config.aleph_x_url}/X?op=#{func}"
      # params as key value with encoding
      params.each do |k, v|
        url += "&#{k}=#{URI.encode_www_form_component(v)}"
      end

      return self if config.test_mode

      response = HTTParty.get(url)
      unless response.success?
        report "Aleph X request failed: #{func} with #{params.inspect} " +
               response.body
        @error = 'X request failed'
      end
      @document = Nokogiri.XML(response.body, nil, 'UTF-8')
      @error    = parse_x_response_errors(@document)
      self
    end
# Variables
# attr_reader :connection
#
#   @@connection   HTTParty object for making requests.


connection   HTTParty object for making requests.
connection HTTParty object for making requests .
def x_request(func, params)
      url = "#{config.aleph_x_url}/X?op=#{func}"
      params.each do |k, v|
        url += "&#{k}=#{URI.encode_www_form_component(v)}"
      end
      return self if config.test_mode
      response = HTTParty.get(url)
      unless response.success?
        report "Aleph X request failed: #{func} with #{params.inspect} " +
               response.body
        @error = 'X request failed'
      end
      @document = Nokogiri.XML(response.body, nil, 'UTF-8')
      @error    = parse_x_response_errors(@document)
      self
    end
def x_request ( func , params ) url = "#{config.aleph_x_url}/X?op=#{func}" params . each do | k , v | url += "&#{k}=#{URI.encode_www_form_component(v)}" end return self if config . test_mode response = HTTParty . get ( url ) unless response . success? report "Aleph X request failed: #{func} with #{params.inspect} " + response . body @error = 'X request failed' end @document = Nokogiri . XML ( response . body , nil , 'UTF-8' ) @error = parse_x_response_errors ( @document ) self end
Variables
attr_reader :connection
Variables attr_reader : connection
# params as key value with encoding
func
params