Class: Ecoportal::API::V2::S3::Files::PollStatus

Inherits:
Common::Content::DoubleModel show all
Defined in:
lib/ecoportal/api/v2/s3/files/poll_status.rb

Defined Under Namespace

Classes: FileContainer

Constant Summary

Constants included from Common::Content::DoubleModel::Diffable

Common::Content::DoubleModel::Diffable::DIFF_CLASS

Constants included from Common::Content::DoubleModel::Base

Common::Content::DoubleModel::Base::NOT_USED

Instance Attribute Summary

Attributes included from Common::Content::DoubleModel::Parented

#_parent, #_parent_key

Instance Method Summary collapse

Methods inherited from Common::Content::DoubleModel

#initialize, new_uuid

Methods included from Common::Content::DoubleModel::Diffable

#as_update, #dirty?

Methods included from Common::Content::Includer

#include_missing

Constructor Details

This class inherits a constructor from Ecoportal::API::Common::Content::DoubleModel

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ecoportal/api/v2/s3/files/poll_status.rb', line 28

def complete?
  success? || failed?
end

#container_idObject



22
23
24
25
26
# File 'lib/ecoportal/api/v2/s3/files/poll_status.rb', line 22

def container_id
  return unless success?

  file&.id
end

#failed?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/ecoportal/api/v2/s3/files/poll_status.rb', line 44

def failed?
  status == 'failed'
end

#pending?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ecoportal/api/v2/s3/files/poll_status.rb', line 36

def pending?
  status == 'pending'
end

#success?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/ecoportal/api/v2/s3/files/poll_status.rb', line 40

def success?
  status == 'success'
end

#timeout?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/ecoportal/api/v2/s3/files/poll_status.rb', line 32

def timeout?
  statut == 'timeout'
end