Closed karenetheridge closed 7 years ago
This could be solved (albeit by making these attribute accesses a bit slower) with this patch to Net/Twitter/Role/OAuth.pm:
# url attributes
for my $attribute ( qw/authentication_url authorization_url request_token_url access_token_url xauth_url/ ) {
has $attribute => (
isa => 'Str', is => 'rw', required => 1,
- # inflate urls to URI objects when read
- reader => { $attribute => sub { URI->new(shift->{$attribute}) } },
);
+ # inflate urls to URI objects when read
+ around $attribute => sub {
+ my ($orig, $self) = (shift, shift);
+ return @_ ? $self->$orig(@_) : URI->new($self->$orig);
+ };
}
@perigrin points out that if you were overwriting the reader like that before, htf could the writer ever work? you're replacing it with a read-only version.
Do these attributes really need to be writable? is this tested anywhere?
The latest Moose now contains more checks for overwriting internal methods, and now Net::Twitter warns...
(newlines added for readability)