class Quandl::Sandbox::Job

Attributes

attempts[RW]
output[RW]
repository[RW]
server[RW]
server_id[RW]

Public Class Methods

new(*args) click to toggle source
# File lib/quandl/sandbox/job.rb, line 5
def initialize(*args)
  options = args.extract_options!.symbolize_keys!
  self.repository = Quandl::Sandbox::Repository.new(options[:repository]) if options[:repository].present?
  self.server = Quandl::Sandbox::Server.find( options[:server_id] ) if options[:server_id].present?
end

Public Instance Methods

datasets() click to toggle source
# File lib/quandl/sandbox/job.rb, line 11
def datasets
  @datasets ||= Quandl::Sandbox::Dataset.from_output( output[:stdout] )
end
execute() click to toggle source
# File lib/quandl/sandbox/job.rb, line 15
def execute
  # run commands that need to happen before importer
  server.exec( repository.script.before_execute )
  # execute importer
  self.output = server.exec( repository.script.execute )
rescue => err
  Quandl::Logger.error( err )
ensure
  server.delete
end
output=(value) click to toggle source
# File lib/quandl/sandbox/job.rb, line 26
def output=(value)
  @datasets = nil
  @output = value
end