Module: HOALife::Resources::Requestable

Included in:
Collection, Persistable
Defined in:
lib/hoalife/resources/requestable.rb

Overview

Client request convenience methods

Instance Method Summary collapse

Instance Method Details

#make_request!(&blk) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/hoalife/resources/requestable.rb', line 5

def make_request!(&blk)
  blk.call
rescue HOALife::RateLimitError => e
  raise e unless HOALife.sleep_when_rate_limited

  sleep HOALife.sleep_when_rate_limited.to_f
  retry
end