diff options
| author | mo khan <mo.khan@gmail.com> | 2020-06-12 17:06:14 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-06-12 17:08:46 -0600 |
| commit | 5e327cc4abe45f53918f7afce937c37fa1736a76 (patch) | |
| tree | ec54bd4c8137e05c6330ca485c2eceddc202a93b /lib/net/hippie.rb | |
| parent | 35fc5298fd9102cc99a63fa7671d09bfdc53b602 (diff) | |
Create default_client to simplify usage
Diffstat (limited to 'lib/net/hippie.rb')
| -rw-r--r-- | lib/net/hippie.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/net/hippie.rb b/lib/net/hippie.rb index 65158b8..fdc282c 100644 --- a/lib/net/hippie.rb +++ b/lib/net/hippie.rb @@ -52,5 +52,15 @@ module Net def self.bearer_auth(token) "Bearer #{token}" end + + def self.method_missing(symbol, *args) + default_client.with_retry(retries: 3) do |client| + client.public_send(symbol, *args) + end + end + + def self.default_client + @subject ||= Client.new + end end end |
