Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: I have finally done it; wrote a Tesla API library for Perl!

by perldigious (Priest)
on Mar 18, 2022 at 22:37 UTC ( [id://11142248]=note: print w/replies, xml ) Need Help??


in reply to I have finally done it; wrote a Tesla API library for Perl!

I've always loved to see your passion for these sorts of things, stevieb. Of course now I'm waiting for the plot twist where your local highway patrol use your own $car->speed data to hold up a speeding ticket you're contesting in court. ;-)

Just another Perl hooker - My clients appreciate that I keep my code clean but my comments dirty.

Replies are listed 'Best First'.
Re^2: I have finally done it; wrote a Tesla API library for Perl!
by stevieb (Canon) on Mar 18, 2022 at 22:46 UTC

    I wrote Mock::Sub several years ago, apparently waiting for this exact problem!

    use warnings; use strict; use feature 'say'; use Mock::Sub; use Tesla::Vehicle; my $mock = Mock::Sub->new; my $car = Tesla::Vehicle->new; my $speed_sub = $mock->mock('Tesla::Vehicle::speed'); $speed_sub->return_value(60); # No matter how fast I'm going, we'll always return 60! say $car->speed;

      In that instance was it best designated as Mock::Sub, or should it have been designated Mock::HighwayPatrol? :-)

      Just another Perl hooker - My clients appreciate that I keep my code clean but my comments dirty.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11142248]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found