class ContentService def self.query(path, payload) MultiJson.load(RestClient::Request.execute( :method => :post, :url => "#{url}/#{path}", :headers => { :content_type => :json, :accept => :json, :user_agent => user_agent, }, :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 def self.user_agent @user_agent ||= ( gem_info = Gem.loaded_specs["infopark_cloud_connector"] "#{gem_info.name}-#{gem_info.version}" ) end end