class ContentService def self.query(path, payload) MultiJson.load(RestClient::Request.execute( :method => :post, :url => "#{url}/#{path}", :headers => { :content_type => :json, :accept => :json, }, :payload => MultiJson.dump(payload) )) end private def self.url @url ||= begin config = RailsConnector::Configuration.content_service "#{config['login']}:#{config['api_key']}@#{config['url']}" end end end