File Coverage

lib/UR/BoolExpr/Template/Composite.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package UR::BoolExpr::Template::Composite;
2              
3 266     266   1014 use warnings;
  266         340  
  266         9005  
4 266     266   1026 use strict;
  266         313  
  266         54582  
5             our $VERSION = "0.46"; # UR $VERSION;;
6              
7             require UR;
8              
9             UR::Object::Type->define(
10             class_name => __PACKAGE__,
11             is => ['UR::BoolExpr::Template'],
12             );
13              
14             # sub _underlying_keys {
15              
16             sub get_underlying_rules_for_values {
17 1     1 0 2 my $self = shift;
18 1         2 my @values = @_;
19 1         6 my @underlying_templates = $self->get_underlying_rule_templates();
20 1         2 my @underlying_rules;
21 1         2 for my $template (@underlying_templates) {
22 2         6 my $n = $template->_variable_value_count;
23 2         6 my $rule = $template->get_rule_for_values(splice(@values,0,$n));
24 2         3 push @underlying_rules, $rule;
25             }
26 1         5 return @underlying_rules;
27             }
28              
29             sub _get_for_subject_class_name_and_logic_detail {
30 6     6   8 my $class = shift;
31 6         5 my $subject_class_name = shift;
32 6         7 my $logic_detail = shift;
33 6         7 my $constant_id = shift;
34            
35 6         21 my ($logic_type) = ($class =~ /^UR::BoolExpr::Template::(.*)/);
36 6         19 my $id = $class->__meta__->resolve_composite_id_from_ordered_values($subject_class_name, $logic_type, $logic_detail, $constant_id);
37            
38 6         24 return $class->get($id);
39             }
40              
41             # sub get_underlying_rule_templates {
42              
43             # sub specifies_value_for {
44              
45             # evalutate_subject_and_values {
46              
47             1;
48              
49             =pod
50              
51             =head1 NAME
52              
53             UR::BoolExpr::Composite - an "and" or "or" rule
54              
55             =head1 SYNOPSIS
56              
57             @r = $r->get_underlying_rules();
58             for (@r) {
59             print $r->evaluate($c1);
60             }
61              
62             =head1 DESCRIPTION
63              
64             =head1 SEE ALSO
65              
66             UR::Object(3), UR::BoolExpr, UR::BoolExpr::Template, UR::BoolExpr::Template::And, UR::BoolExpr::Template::Or, UR::BoolExpr::Template::PropertyComparison
67              
68             =cut