Class: Conductor::DeferredExport

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/deferred_export.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DeferredExport

Returns a new instance of DeferredExport.



5
6
7
8
9
# File 'lib/conductor/deferred_export.rb', line 5

def initialize(options={})
  @id       = options.fetch(:id)
  @callback = options.fetch(:callback)
  @context  = options.fetch(:context, self)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/conductor/deferred_export.rb', line 3

def id
  @id
end

Instance Method Details

#export(export_value = nil) ⇒ Object



11
12
13
# File 'lib/conductor/deferred_export.rb', line 11

def export(export_value=nil)
  context.instance_eval { @callback.call export_value }
end