class Oshpark::Upload

Constants

STATES

Public Class Methods

attrs() click to toggle source
# File lib/oshpark/upload.rb, line 3
def self.attrs
  %w| id state original_filename error_message queued_at started_at completed_at errored_at failed_at project_id |
end
create(file) click to toggle source
# File lib/oshpark/upload.rb, line 13
def self.create file
  self.from_json(Oshpark::client.create_upload(file)['upload'])
end

Public Instance Methods

completed_at() click to toggle source
# File lib/oshpark/upload.rb, line 37
def completed_at
  time_from @completed_at
end
errored_at() click to toggle source
# File lib/oshpark/upload.rb, line 41
def errored_at
  time_from @errored_at
end
failed_at() click to toggle source
# File lib/oshpark/upload.rb, line 45
def failed_at
  time_from @failed_at
end
finished?() click to toggle source
# File lib/oshpark/upload.rb, line 25
def finished?
  success? || error? || failed?
end
processing?() click to toggle source
# File lib/oshpark/upload.rb, line 21
def processing?
  waiting? || running?
end
project() click to toggle source
# File lib/oshpark/upload.rb, line 17
def project
  Project.find project_id
end
queued_at() click to toggle source
# File lib/oshpark/upload.rb, line 29
def queued_at
  time_from @queued_at
end
started_at() click to toggle source
# File lib/oshpark/upload.rb, line 33
def started_at
  time_from @started_at
end