class Importer

Public Instance Methods

import(file) click to toggle source
# File lib/bidding/tools/importer.rb, line 7
def import file
  p 'importing file ' + file
  transaction = JSON File.read file

  transaction.each { |trans| 
    commands = trans["commands"]
    commands.each { |command_string| 
      command = Command.parse command_string, trans["user"], Time.at(trans["date"])
      command.replay
    }
  }

  File.delete file

end