File: Nested.pm

package info (click to toggle)
liboptimade-propertydefinitions-perl 0.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 4,996 kB
  • sloc: sh: 348; perl: 184; python: 38; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 453 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package OPTIMADE::PropertyDefinitions::Property::Nested;

# ABSTRACT: OPTIMADE Nested property
our $VERSION = '0.1.0'; # VERSION

use strict;
use warnings;

use parent OPTIMADE::PropertyDefinitions::Property::;

sub raw()
{
    my( $self ) = @_;
    if( $self->parent->optimade_type eq 'list' ) {
        return $self->parent->raw->{items}{properties}{$self->name};
    } else {
        return $self->parent->raw->{properties}{$self->name};
    }
}

1;