lib/epom/placement.rb in epom-0.9.9 vs lib/epom/placement.rb in epom-0.10

- old
+ new

@@ -11,10 +11,17 @@ :url => '/rest-api/placements/PLACEMENT_ID/delete.do', :url_parameters => [:placementId], :body_parameters => [:hash, :timestamp, :username], :method => :post }, + :set_placement_pricing => { + :url => '/rest-api/placements/PLACEMENT_ID/pricing.do?username=USERNAME&timestamp=TIMESTAMP&hash=HASH', + :url_parameters => [:placementId, :hash, :timestamp, :username], + :body_parameters => [], + :method => :post, + :headers => {'Content-type' => 'application/json'} + }, :get_placement_summary => { :url => '/rest-api/placements/summary.do', :body_parameters => [:placementIds, :publishingCategories, :hash, :timestamp, :username], :method => :get }, @@ -55,9 +62,12 @@ } } end def self.replace_params_in_url(url, url_params) + url.gsub!('USERNAME', url_params[:username].to_s) if url.include?('USERNAME') + url.gsub!('TIMESTAMP', url_params[:timestamp].to_s) if url.include?('TIMESTAMP') + url.gsub!('HASH', url_params[:hash].to_s) if url.include?('HASH') url.gsub!('PLACEMENT_ID', url_params[:placementId].to_s) if url.include?('PLACEMENT_ID') url end end end \ No newline at end of file