Incomplete work for refactoring regions and flows

This commit is contained in:
Alessandro Ranellucci 2013-12-30 18:28:41 +01:00
parent 231bffa99b
commit beb1baa096
13 changed files with 297 additions and 148 deletions

View file

@ -175,6 +175,22 @@ sub setenv {
}
}
sub equals {
my ($self, $other) = @_;
return @{ $self->diff($other) } == 0;
}
sub diff {
my ($self, $other) = @_;
my @diff = ();
foreach my $opt_key (sort @{$self->get_keys}) {
push @diff, $opt_key
if !$other->has($opt_key) || $other->serialize($opt_key) ne $self->serialize($opt_key);
}
return [@diff];
}
# this method is idempotent by design
sub validate {
my $self = shift;