Class: Performance

Inherits:
Decorator show all
Defined in:
lib/performance_promise/performance.rb

Direct Known Subclasses

Speedy

Instance Method Summary collapse

Methods inherited from Decorator

decorator_name, inherited

Constructor Details

#initialize(klass, method, options) ⇒ Performance

Returns a new instance of Performance.



5
6
7
8
# File 'lib/performance_promise/performance.rb', line 5

def initialize(klass, method, options)
  @klass, @method = klass, method
  PerformancePromise.promises["#{klass}\##{method.name.to_s}"] = options
end

Instance Method Details

#call(this, *args) ⇒ Object



10
11
12
# File 'lib/performance_promise/performance.rb', line 10

def call(this, *args)
  @method.bind(this).call(*args)
end