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.



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

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

Instance Method Details

#runObject



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

def run
  @block.call(ds)
end

#sourceObject



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

def source
  @label || @block.to_s
end