Class: Bricolage::TDTask::Delete

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

Instance Method Summary collapse

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_argsObject



104
105
106
# File 'lib/bricolage/tddatasource.rb', line 104

def command_args
  ds.delete_command_args(@table, "--from #{@from}", "--to #{@to}")
end

#runObject



100
101
102
# File 'lib/bricolage/tddatasource.rb', line 100

def run
  td_result = ds.exec(source)
end

#sourceObject



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