Sha256: 598670c4a9892fb5f6c86253d4e8a6e1cf47eff458a78cd4f9fac98b19404a95

Contents?: true

Size: 391 Bytes

Versions: 323

Compression:

Stored size: 391 Bytes

Contents

package Example;

use strict;
use warnings;

use DateTime;

sub new {
  my ($class, $year, $month, $day) = @_;

  my $date = DateTime->new(year => $year, month => $month, day => $day);
  my $giga = DateTime::Duration->new(seconds => 1_000_000_000);
  bless { date => $date->add_duration($giga) }, $class;
}

sub date {
  my ($self) = @_;
  return $self->{date}->truncate(to => 'day');
}

1;

Version data entries

323 entries across 323 versions & 1 rubygems

Version Path
trackler-2.2.1.105 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.104 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.103 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.102 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.101 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.100 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.99 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.98 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.97 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.96 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.95 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.94 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.93 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.92 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.91 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.90 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.89 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.88 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.87 tracks/perl5/exercises/gigasecond/Example.pm
trackler-2.2.1.86 tracks/perl5/exercises/gigasecond/Example.pm