| 1 | package Finance::GDAX::API::Time; | ||
| 2 | 1 | our $VERSION = '0.01'; | |
| 3 | 1 | ▶ | use 5.20.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Finance::GDAX::API; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | extends 'Finance::GDAX::API'; | |
| 10 | |||
| 11 | sub get { | ||
| 12 | 1 | ▶ | my $self = shift; |
|
Subroutine
get: called CC=1 SCAR=0.0
Pod
documented
| |||
| 13 | 1 | $self->method('GET'); | |
| 14 | 1 | $self->path('/time'); | |
| 15 | 1 | return $self->send; | |
| 16 | } | ||
| 17 | |||
| 18 | 1 | __PACKAGE__->meta->make_immutable; | |
| 19 | 1 | 1; | |
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Finance::GDAX::API::Time - Time | ||
| 24 | |||
| 25 | =head1 SYNOPSIS | ||
| 26 | |||
| 27 | use Finance::GDAX::API::Time; | ||
| 28 | |||
| 29 | $time = Finance::GDAX::API::Time->new; | ||
| 30 | |||
| 31 | # Get current time | ||
| 32 | $time_hash = $time->get; | ||
| 33 | |||
| 34 | =head2 DESCRIPTION | ||
| 35 | |||
| 36 | Gets the time reported by GDAX. | ||
| 37 | |||
| 38 | =head1 METHODS | ||
| 39 | |||
| 40 | =head2 C<get> | ||
| 41 | |||
| 42 | Returns a hash representing the GDAX API server's notion of current | ||
| 43 | time. | ||
| 44 | |||
| 45 | From the GDAX API: | ||
| 46 | |||
| 47 | { | ||
| 48 | "iso": "2015-01-07T23:47:25.201Z", | ||
| 49 | "epoch": 1420674445.201 | ||
| 50 | } | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | |||
| 55 | =head1 AUTHOR | ||
| 56 | |||
| 57 | Mark Rushing <mark@orbislumen.net> | ||
| 58 | |||
| 59 | =head1 COPYRIGHT AND LICENSE | ||
| 60 | |||
| 61 | This software is copyright (c) 2017 by Home Grown Systems, SPC. | ||
| 62 | |||
| 63 | This is free software; you can redistribute it and/or modify it under | ||
| 64 | the same terms as the Perl 5 programming language system itself. | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||