Class: CallbackBatch::Call

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

Overview

Calls catcher.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(batch, target) ⇒ Call

Constructor.

Parameters:

  • batch (EM::Batch)

    parent batch

  • target (Object)

    target object for wrap



227
228
229
230
# File 'lib/callback-batch.rb', line 227

def initialize(batch, target)
    @batch = batch
    @target = target
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object

Missing methods catcher which puts the calls to parent batch.

Parameters:

  • name (Symbol)

    method name

  • *args (Array)

    method arguments list



239
240
241
# File 'lib/callback-batch.rb', line 239

def method_missing(name, *args)
    @batch.put(@target, name, args)
end

Instance Attribute Details

#batchEM::Batch (readonly)

Holds parent batch object.

Returns:

  • (EM::Batch)


209
210
211
# File 'lib/callback-batch.rb', line 209

def batch
  @batch
end

#targetObject

Holds the wrapped object.

Returns:

  • (Object)


217
218
219
# File 'lib/callback-batch.rb', line 217

def target
  @target
end