NAME
Moo::Google::Util - Portable functions
VERSION
version 0.01
METHODS
substitute_placeholders
placeholderS (S)!
warn $gapi->Calendar->Events->substitute_placeholders('users/{token}/calendarList/{calendarId}/{eventID}', {
token =>'12345',
calendarId => '54321',
eventId => 'abcdef'
}); # must be users/12345/calendarList/54321/abcdef
or
$gapi->Calendar->Events->token('12345');
$gapi->Calendar->Events->calendarId('54321');
$gapi->Calendar->Events->eventId('abcdef');
# all atributes must be set in class
warn $gapi->Calendar->Events->substitute_placeholders('users/{token}/calendarList/{calendarId}/{eventID}'); # must be users/12345/calendarList/54321/abcdef
substitute_placeholder
Substitute only one placeholder (first in string)
substitute_placeholders('users/me/calendarList/{calendarId}/', '12345'); # will return 'users/me/calendarList/12345'
but
substitute_placeholders('users/me/calendarList/{calendarId}/{placeholder2}', '12345'); # will return 'users/me/calendarList/12345/{placeholder2}'
AUTHOR
Pavel Serikov <pavelsr@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Pavel Serikov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.