Module: ThrottledObject

Defined in:
lib/throttled_object.rb,
lib/throttled_object/lock.rb,
lib/throttled_object/proxy.rb,
lib/throttled_object/version.rb

Defined Under Namespace

Classes: Lock, Proxy

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

.make(object, options = {}, *args) ⇒ Object



7
8
9
10
11
12
# File 'lib/throttled_object.rb', line 7

def self.make(object, options = {}, *args)
  object_options = args.last.is_a?(Hash) ? args.pop : {}
  object_options[:lock] = Lock.new(options)
  args << object_options
  Proxy.new object, *args
end