lib/eucalyptus/custom_audience.rb in eucalyptus-1.0.0 vs lib/eucalyptus/custom_audience.rb in eucalyptus-1.1.0
- old
+ new
@@ -15,18 +15,24 @@
emails = emails.collect{|email| Digest::SHA256.hexdigest(email)}
payload = {schema: "EMAIL_SHA256", data: emails}.to_json
graph.put_connections(self.id, 'users', payload: payload)
end
+ def remove(emails, graph: Eucalyptus.graph)
+ emails = emails.collect{|email| Digest::SHA256.hexdigest(email)}
+ payload = {schema: "EMAIL_SHA256", data: emails}.to_json
+ graph.delete_connections(self.id, 'users', payload: payload)
+ end
+
def ad_sets(from_collection: AdSet.all)
from_collection.collect do |ad_set|
if ad_set.targeting.custom_audiences
ad_set if ad_set.targeting.custom_audiences.any?{|a| a["id"] == self.id }
end
end.compact
end
def self.known_fields
- [:name, :description]
+ [:name, :description, :approximate_count]
end
end
end