Class: Bricolage::TDTask::Delete
- Inherits:
-
Action
- Object
- Action
- Bricolage::TDTask::Delete
- Defined in:
- lib/bricolage/tddatasource.rb
Instance Method Summary collapse
- #command_args ⇒ Object
-
#initialize(table_name, from:, to:) ⇒ Delete
constructor
A new instance of Delete.
- #run ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(table_name, from:, to:) ⇒ Delete
Returns a new instance of Delete.
94 95 96 97 98 |
# File 'lib/bricolage/tddatasource.rb', line 94 def initialize(table_name, from:, to:) @table = table_name @from = from.to_time.to_i @to = to.to_time.to_i end |
Instance Method Details
#command_args ⇒ Object
104 105 106 |
# File 'lib/bricolage/tddatasource.rb', line 104 def command_args ds.delete_command_args(@table, "--from #{@from}", "--to #{@to}") end |
#run ⇒ Object
100 101 102 |
# File 'lib/bricolage/tddatasource.rb', line 100 def run td_result = ds.exec(source) end |
#source ⇒ Object
108 109 110 111 112 |
# File 'lib/bricolage/tddatasource.rb', line 108 def source buf = StringIO.new buf.puts command_args.join(' ') buf.string end |