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 inherited from Common::Content::DoubleModel

Common::Content::DoubleModel::NOT_USED

Constants included from Common::Content::ClassHelpers

Common::Content::ClassHelpers::NOT_USED

Instance Attribute Summary

Attributes inherited from Common::Content::DoubleModel

#_key, #_parent, #_read_only

Instance Method Summary collapse

Methods inherited from Common::Content::DoubleModel

#_doc_key, #as_json, #as_update, #consolidate!, #dirty?, #doc, embeds_many, embeds_one, enforce!, #initialize, #key, #key=, key?, new_uuid, #original_doc, pass_reader, pass_writer, passarray, passboolean, passdate, passforced, passkey, passthrough, #print_pretty, read_only!, read_only?, #read_only?, #replace_doc, #reset!, #resolved_doc_key, #root, #to_json

Methods included from Common::Content::ClassHelpers

#inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant, #to_time, #uid, #used_param?

Constructor Details

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

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)
[View source]

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

def complete?
  success? || failed?
end

#container_idObject

[View source]

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)
[View source]

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

def failed?
  status == "failed"
end

#pending?Boolean

Returns:

  • (Boolean)
[View source]

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

def pending?
  status == "pending"
end

#success?Boolean

Returns:

  • (Boolean)
[View source]

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

def success?
  status == "success"
end

#timeout?Boolean

Returns:

  • (Boolean)
[View source]

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

def timeout?
  statut == 'timeout'
end