Class: SodaXmlTeam::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/soda_xml_team/client.rb

Direct Known Subclasses

Address

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ Client



11
12
13
14
# File 'lib/soda_xml_team/client.rb', line 11

def initialize(username, password)
  @auth = {:username => username, :password => password}
  @certs = 'lib/ca-bundle.crt'
end

Instance Method Details

#get_document(options = {}) ⇒ Object



21
22
23
24
# File 'lib/soda_xml_team/client.rb', line 21

def get_document(options={})
  response = HTTParty.get(SodaXmlTeam::Address.build("get_document", options), :basic_auth => @auth, :ssl_ca_file => @certs)
  Nokogiri::XML(response.body)
end

#get_listing(options = {}) ⇒ Object



16
17
18
19
# File 'lib/soda_xml_team/client.rb', line 16

def get_listing(options={})
  response = HTTParty.get(SodaXmlTeam::Address.build("get_listing", options), :basic_auth => @auth, :ssl_ca_file => @certs)
  Nokogiri::XML(response.body)
end