File: ProxModifierSet.pm

package info (click to toggle)
libcql-parser-perl 1.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 324 kB
  • sloc: perl: 2,388; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (4)
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
package CQL::ProxModifierSet;

use strict;
use warnings;
use base qw( CQL::ModifierSet );
use CQL::Utils qw( indent xq );
use Carp qw( croak );
use CQL::ModifierSet;

=head1 NAME

CQL::ProxModifierSet - represents a base string and modifier strings 

=head1 SYNOPSIS

=head1 DESCRIPTION

This class is used as a delegate by CQLProxNode based on ModifierSet
data structure.

=head1 METHODS

=head2 toCQL()

=cut

sub toCQL {
    my $self = shift;
    my $cql = $self->{base};

    my $distance = $self->modifier("distance");
    my $relation = $self->modifier("relation");
    my $unit = $self->modifier("unit");
    my $ordering = $self->modifier("ordering");

    $cql .= "/distance$relation$distance"
	if defined $distance and defined $relation;
    $cql .= "/unit=$unit" if defined $unit;
    $cql .= "/$ordering" if defined $ordering;

    return $cql;
}

1;