package Podius::Component::Address;

use base 'Podius::Component::Publishable';

use Podius::Property::Scalar;
use Podius::Property::BigScalar;

sub get_own_property_types ($) {
	return [
		[ street_address => 'BigScalar' ],
		[ city           => 'Scalar' ],
		[ state          => 'Scalar' ],
		[ zip            => 'Scalar' ],
		[ country        => 'Scalar' ],
	];
}

sub get_name ($) {
	my $self = shift;
	return $self->name || substr(
		($self->country || "No country") . ", " .
		($self->city || "No city") . ", " .
		($self->street_address || "No street"
	), 0, 36);
}

1;