Class: Neoid::BatchPromiseProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/neoid/batch.rb

Overview

returned from a full batch, after it has been executed, so a ‘.then` can be chained after the batch do … end it proxies all methods to the result

Instance Method Summary collapse

Constructor Details

#initialize(results) ⇒ BatchPromiseProxy

Returns a new instance of BatchPromiseProxy.



122
123
124
# File 'lib/neoid/batch.rb', line 122

def initialize(results)
  @results = results
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



126
127
128
# File 'lib/neoid/batch.rb', line 126

def method_missing(method, *args)
  @results.send(method, *args)
end

Instance Method Details

#then {|@results| ... } ⇒ Object

Yields:

  • (@results)


130
131
132
# File 'lib/neoid/batch.rb', line 130

def then
  yield(@results)
end