Skip to content

Commit

Permalink
refactor code: group vendor section
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed Dec 15, 2023
1 parent bded2ae commit be9b81c
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions lib/GDPR/IAB/TCFv2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,7 @@ sub Parse {

croak 'invalid vendor list version' if $self->vendor_list_version == 0;

# parse vendor section
# parse vendor consent

my $legitimate_interest_offset = $self->_parse_vendor_consents();

# parse vendor legitimate interest

my $pub_restrict_offset =
$self->_parse_vendor_legitimate_interests($legitimate_interest_offset);
my $pub_restrict_offset = $self->_parse_vendor_section();

# parse publisher section

Expand Down Expand Up @@ -416,6 +408,21 @@ sub TO_JSON {
};
}

sub _parse_vendor_section {
my $self = shift;

# parse vendor consent

my $legitimate_interest_offset = $self->_parse_vendor_consents();

# parse vendor legitimate interest

my $pub_restrict_offset =
$self->_parse_vendor_legitimate_interests($legitimate_interest_offset);

return $pub_restrict_offset;
}


sub _parse_vendor_consents {
my $self = shift;
Expand Down

0 comments on commit be9b81c

Please sign in to comment.