Class: Bricolage::GenericTask::AnyAction

Inherits:
Action
  • Object
show all
Defined in:
lib/bricolage/genericdatasource.rb

Instance Method Summary collapse

Constructor Details

#initialize(label, block) ⇒ AnyAction

Returns a new instance of AnyAction.



23
24
25
26
# File 'lib/bricolage/genericdatasource.rb', line 23

def initialize(label, block)
  @label = label
  @block = block
end

Instance Method Details

#runObject



32
33
34
# File 'lib/bricolage/genericdatasource.rb', line 32

def run
  @block.call(ds)
end

#sourceObject



28
29
30
# File 'lib/bricolage/genericdatasource.rb', line 28

def source
  @label || @block.to_s
end