class Arbetsformedlingen::API::LedigtarbeteClient
API
client for ledigtarbete
Constants
- BASE_URL
Base URL for ledigtarbete
- HEADERS
HTTP headers
Public Instance Methods
create_ad(packet)
click to toggle source
Post ad to API
@param [Arbetsformedlingen::Packet, to_xml] packet the data to be sent @return [Values::CreateAdPage] the API
result
# File lib/arbetsformedlingen/api/ledigtarbete_client.rb, line 21 def create_ad(packet) xml = packet.to_xml url = if Arbetsformedlingen.config.test 'apiledigtarbete/test/hrxml' else 'apiledigtarbete/hrxml' end response = HTTParty.post("#{BASE_URL}/#{url}", body: xml, headers: HEADERS) Values::CreateAdPage.new(response, xml) end