View Source Gpp.Sections.Tcf (Gpp v0.1.0)

IAB Transparency and Consent Framework v1.1 & v2.0 String Decoding.

Only decodes the "version" and the "vendor consents" parts of the "core" segment.

Link to this section Summary

Functions

Checks if the provided vendor_id is in the list of vendor_consents

Link to this section Types

@type t() :: %Gpp.Sections.Tcf{vendor_consents: [vendor_id()], version: pos_integer()}
@type vendor_id() :: pos_integer()

Link to this section Functions

Link to this function

vendor_has_consent?(map, vendor_id)

View Source
@spec vendor_has_consent?(t(), vendor_id()) :: boolean()

Checks if the provided vendor_id is in the list of vendor_consents

examples

Examples

iex> Tcf.vendor_has_consent?(%Tcf{vendor_consents: [8, 6, 2]}, 8)
true

iex> Tcf.vendor_has_consent?(%Tcf{vendor_consents: [8, 6, 2]}, 123)
false