lib/asana/resource_includes/events.rb in asana-0.6.0 vs lib/asana/resource_includes/events.rb in asana-0.6.2

- old
+ new

@@ -92,12 +92,12 @@ { resource: @resource, sync: @sync }.reject { |_, v| v.nil? } end # Internal: Executes a block if at least @wait seconds have passed since # @last_poll. - def rate_limiting(&block) + def rate_limiting return if @last_poll && Time.now - @last_poll <= @wait - block.call.tap { @last_poll = Time.now } + yield.tap { @last_poll = Time.now } end end end end