File: Composite.pm

package info (click to toggle)
libur-perl 0.470%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,192 kB
  • sloc: perl: 61,814; javascript: 255; xml: 108; sh: 13; makefile: 9
file content (68 lines) | stat: -rw-r--r-- 1,566 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package UR::BoolExpr::Template::Composite;

use warnings;
use strict;
our $VERSION = "0.47"; # UR $VERSION;

require UR;

UR::Object::Type->define(
    class_name  => __PACKAGE__,
    is          => ['UR::BoolExpr::Template'],
);

# sub _underlying_keys {

sub get_underlying_rules_for_values {
    my $self = shift;
    my @values = @_;    
    my @underlying_templates = $self->get_underlying_rule_templates();
    my @underlying_rules;
    for my $template (@underlying_templates) {
        my $n = $template->_variable_value_count;
        my $rule = $template->get_rule_for_values(splice(@values,0,$n));
        push @underlying_rules, $rule;
    }
    return @underlying_rules;
}

sub _get_for_subject_class_name_and_logic_detail {
    my $class = shift;
    my $subject_class_name = shift;
    my $logic_detail = shift;
    my $constant_id = shift;
    
    my ($logic_type) = ($class =~ /^UR::BoolExpr::Template::(.*)/); 
    my $id = $class->__meta__->resolve_composite_id_from_ordered_values($subject_class_name, $logic_type, $logic_detail, $constant_id);
    
    return $class->get($id);
}

# sub get_underlying_rule_templates {

# sub specifies_value_for {

# evalutate_subject_and_values {

1;

=pod

=head1 NAME

UR::BoolExpr::Composite - an "and" or "or" rule

=head1 SYNOPSIS

@r = $r->get_underlying_rules();
for (@r) {
    print $r->evaluate($c1);
}

=head1 DESCRIPTION

=head1 SEE ALSO

UR::Object(3), UR::BoolExpr, UR::BoolExpr::Template, UR::BoolExpr::Template::And, UR::BoolExpr::Template::Or, UR::BoolExpr::Template::PropertyComparison

=cut