The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Google::RestApi::SheetsApi4::Range::Iterator - Perl API to Google Sheets API V4.

DESCRIPTION

A Range::Iterator is used to iterate through a range, returning each cell, one at a time.

See the description and synopsis at Google::RestApi::SheetsApi4.

SUBROUTINES

new(range => <Range>, dim => <dimension>, by => <int>);

Creates a new Iterator object for the given range.

 range: The Range object for which we are iterating.
 dim: The direction of the iteration ('col' or 'row'). The default is 'row'.
 by: The number of cells to skip between each iteration.

'dim' is used to specify which major dimension is used for the iteration. For a given range 'A1:B2', a 'dim' of 'col' will return A1, A2, B1, B2 for each successive iteration. For a 'dim' of 'row', it will return A1, B1, A2, B2 for each successive iteration.

'by' is used to allow you to only return, say, every second cell in the iteration ('by' = '2'). For a given range 'A1:B4' and a 'by' of '2', it will return A1, A3, B1, B3 for each succesive iteration.

You would not normally call this directly, you'd use the Range::iterator method to create the iterator object for you.

iterate();

Return the next cell in the iteration sequence.

next();

An alias for iterate().

range();

Returns the Range object for this iterator.

worksheet();

# Returns the Worksheet object for this iterator.

AUTHORS

  • Robin Murray mvsjes@cpan.org

COPYRIGHT

Copyright (c) 2019, Robin Murray. All rights reserved.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.