NAME

Finance::Robinhood::Utility::Iterator - Sugary Access to Paginated Data

SYNOPSIS

use Finance::Robinhood;
my $rh = t::Utility::rh_instance(1);
my $instruments = $rh->instruments();

for my $instrument ($instruments->all) {
    CORE::say $instrument->symbol;
}

METHODS

reset( )

Reset the iterator. All elements will be removed and you'll basically start from scratch.

current( )

Get the current element without removing it from the stack. This is non-destructive but will move the cursor if there is no current element.

next( )

Gets the next element and removes it from the stack. If there are no elements and all pages have been exhausted, this will return an undefined value.

peek( ... )

my $ten_more = $list->peek(10);

Returns the nth element without removing it from the stack. The index is optional and, by default, the first element is returned.

has_next( ... )

Returns a boolean indicating whether or not we have another X elements. The length is optional and checks the results for a a single element by default.

take( ... )

Removes a number of elements from the stack and returns them. By default, this returns a single element.

all( )

Grabs every page and returns every element we see.

LEGAL

This is a simple wrapper around the API used in the official apps. The author provides no investment, legal, or tax advice and is not responsible for any damages incurred while using this software. This software is not affiliated with Robinhood Financial LLC in any way.

For Robinhood's terms and disclosures, please see their website at https://robinhood.com/legal/

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module. Please refer to the LEGAL section.

AUTHOR

Sanko Robinson <sanko@cpan.org>