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
|
package OPTIMADE::PropertyDefinitions::EntryType;
# ABSTRACT: OPTIMADE Entry Type
our $VERSION = '0.1.0'; # VERSION
use strict;
use warnings;
use OPTIMADE::PropertyDefinitions::Property;
sub new
{
my( $class, $parent, $name ) = @_;
return bless { parent => $parent, name => $name }, $class;
}
sub property($)
{
my( $self, $property ) = @_;
die "no such property '$property'\n" unless $self->raw->{properties}{$property};
return OPTIMADE::PropertyDefinitions::Property->new( $self, $property );
}
sub properties()
{
my( $self ) = @_;
return map { OPTIMADE::PropertyDefinitions::Property->new( $self, $_ ) }
sort keys %{$self->raw->{properties}};
}
sub name() { $_[0]->{name} }
sub parent() { $_[0]->{parent} }
sub raw() { $_[0]->parent->raw->{entrytypes}{$_[0]->name} }
1;
|