Acme-Oppai

 view release on metacpan or  search on metacpan

lib/Acme/Oppai.pm  view on Meta::CPAN

package Acme::Oppai;

use strict;
use warnings;
use utf8;

use Encode;
use Encode::Guess;
use Scalar::Util qw(blessed);

our $VERSION = '0.03';

our %BASIC_AA = (
                 oppai => sub {
                     my $word = shift;
                     return <<OPPAI;
  _  ∩
( ゜∀゜)彡 $word
 ⊂彡

lib/Acme/Oppai.pm  view on Meta::CPAN


sub new {
    my $class = shift;
    my %opt = @_;

    my $str = '';
    my $self = [
                \$str,
                \%opt,
                ];
    $self = bless $self, $class;

    $self->clear;
    $self;
}

sub clear {
    my $self = shift;
    my $str = '';
    $self->[0] = \$str;
    $self->[2] = 0;

lib/Acme/Oppai.pm  view on Meta::CPAN

    $enc->decode($word);
}

sub gen {
    my ($self, $type, $word) = @_;
    $BASIC_AA{$type}($word);
}

sub base {
    my $proto = shift;
    my $self = blessed($proto) ? $proto : $proto->new;
    my $type = shift;

    if ($self->[1]->{default}) {
        $type .= "_$1" if $self->[1]->{default} =~ /^(up|down)$/;
    } else {
        if ($self->[2] eq 1) {
            ${ $self->[0] } = $self->gen($self->[3]->[0]->{type} . '_up', $self->[3]->[0]->{word});
        }
        $self->[2]++;
        if ($self->[2] ne 1) {



( run in 1.266 second using v1.01-cache-2.11-cpan-de7293f3b23 )