File: Boolean.pm

package info (click to toggle)
liboptimade-filter-perl 0.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 764 kB
  • sloc: perl: 947; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 468 bytes parent folder | download
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
package OPTIMADE::Filter::Boolean;

use strict;
use warnings;

use parent 'OPTIMADE::Filter::Modifiable';

our $VERSION = '0.11.0'; # VERSION

sub new {
    my( $class, $value ) = @_;
    return bless { value => $value }, $class;
}

sub to_filter
{
    my $self = shift;
    return $self->{value} ? 'TRUE' : 'FALSE';
}

sub to_SQL
{
    die "no SQL representation\n";
}

sub modify
{
    my $self = shift;
    my $code = shift;

    return $code->( $self, @_ );
}

1;