class Bricolage::DataSourceTask
Attributes
ds[R]
Public Class Methods
new(ds)
click to toggle source
# File lib/bricolage/script.rb, line 65 def initialize(ds) @ds = ds @actions = [] end
Public Instance Methods
bind(*args)
click to toggle source
# File lib/bricolage/script.rb, line 72 def bind(*args) @actions.each do |action| action.bind(*args) end end
run()
click to toggle source
# File lib/bricolage/script.rb, line 78 def run result = nil @ds.open_for_batch { @actions.each do |action| result = action.run end } result end
source()
click to toggle source
# File lib/bricolage/script.rb, line 88 def source buf = StringIO.new @actions.each do |action| buf.puts action.source end buf.string end
Private Instance Methods
add(action)
click to toggle source
# File lib/bricolage/script.rb, line 98 def add(action) action.ds = @ds @actions.push action end
each_action(&block)
click to toggle source
# File lib/bricolage/script.rb, line 103 def each_action(&block) @actions.each(&block) end