Class: Bricolage::DataSourceTask
- Inherits:
-
Object
- Object
- Bricolage::DataSourceTask
- Defined in:
- lib/bricolage/script.rb
Defined Under Namespace
Classes: Action
Instance Attribute Summary collapse
-
#ds ⇒ Object
readonly
Returns the value of attribute ds.
Instance Method Summary collapse
- #bind(*args) ⇒ Object
-
#initialize(ds) ⇒ DataSourceTask
constructor
A new instance of DataSourceTask.
- #run ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(ds) ⇒ DataSourceTask
Returns a new instance of DataSourceTask.
65 66 67 68 |
# File 'lib/bricolage/script.rb', line 65 def initialize(ds) @ds = ds @actions = [] end |
Instance Attribute Details
#ds ⇒ Object (readonly)
Returns the value of attribute ds.
70 71 72 |
# File 'lib/bricolage/script.rb', line 70 def ds @ds end |
Instance Method Details
#bind(*args) ⇒ Object
72 73 74 75 76 |
# File 'lib/bricolage/script.rb', line 72 def bind(*args) @actions.each do |action| action.bind(*args) end end |
#run ⇒ Object
78 79 80 81 82 83 84 85 86 |
# 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 ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/bricolage/script.rb', line 88 def source buf = StringIO.new @actions.each do |action| buf.puts action.source end buf.string end |