lib/voucherify/service/validation_rules.rb in voucherify-3.0.0 vs lib/voucherify/service/validation_rules.rb in voucherify-4.0.0
- old
+ new
@@ -20,31 +20,31 @@
def list(query)
@client.get('/validation-rules', query)
end
def get(id)
- @client.get("/validation-rules/#{URI.encode(id)}")
+ @client.get("/validation-rules/#{ERB::Util.url_encode(id)}")
end
def update(validation_rules)
- @client.put("/validation-rules/#{URI.encode(validation_rules['id'] || validation_rules[:id])}", validation_rules.to_json)
+ @client.put("/validation-rules/#{ERB::Util.url_encode(validation_rules['id'] || validation_rules[:id])}", validation_rules.to_json)
end
def delete(id)
- @client.delete("/validation-rules/#{URI.encode(id)}")
+ @client.delete("/validation-rules/#{ERB::Util.url_encode(id)}")
end
def createAssignment(id, assignment)
- @client.post("/validation-rules/#{URI.encode(id)}/assignments", assignment.to_json)
+ @client.post("/validation-rules/#{ERB::Util.url_encode(id)}/assignments", assignment.to_json)
end
def deleteAssignment(rule_id, assignment_id)
- @client.delete("/validation-rules/#{URI.encode(rule_id)}/assignments/#{URI.encode(assignment_id)}")
+ @client.delete("/validation-rules/#{ERB::Util.url_encode(rule_id)}/assignments/#{ERB::Util.url_encode(assignment_id)}")
end
def listAssignments(id, query)
- @client.get("/validation-rules/#{URI.encode(id)}/assignments", query)
+ @client.get("/validation-rules/#{ERB::Util.url_encode(id)}/assignments", query)
end
end
class ValidationRulesAssignments
attr_reader :client
@@ -52,18 +52,18 @@
def initialize(client)
@client = client
end
def create(rule_id, assignment)
- @client.post("/validation-rules/#{URI.encode(rule_id)}/assignments", assignment.to_json)
+ @client.post("/validation-rules/#{ERB::Util.url_encode(rule_id)}/assignments", assignment.to_json)
end
def delete(rule_id, assignment_id)
- @client.delete("/validation-rules/#{URI.encode(rule_id)}/assignments/#{URI.encode(assignment_id)}")
+ @client.delete("/validation-rules/#{ERB::Util.url_encode(rule_id)}/assignments/#{ERB::Util.url_encode(assignment_id)}")
end
def list(rule_id, query)
- @client.get("/validation-rules/#{URI.encode(rule_id)}/assignments", query)
+ @client.get("/validation-rules/#{ERB::Util.url_encode(rule_id)}/assignments", query)
end
end
end
end