<?php

namespace NoahVet\Reef\Domain\Security\Model;

class ResourceType implements \Stringable
{
    final protected function __construct(
        protected string $slug,
    ) {
    }

    #[\Override]
    public function __toString(): string
    {
        return $this->slug;
    }

    public static function fromString(string $slug): static
    {
        return new static($slug);
    }

    public function getSlug(): string
    {
        return $this->slug;
    }

    public function getGroupSlug(): string
    {
        return $this->slug.'s';
    }
}
