Class: Ecoportal::API::V2::S3::Files::Poll
Constant Summary
Common::Content::DoubleModel::NOT_USED
Common::Content::ClassHelpers::NOT_USED
Instance Attribute Summary
#_key, #_parent, #_read_only
Instance Method Summary
collapse
#_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
#inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant, #to_time, #uid, #used_param?
Instance Method Details
#complete? ⇒ Boolean
49
50
51
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 49
def complete?
status&.complete?
end
|
#container_id ⇒ Object
The final File eP container id
19
20
21
22
23
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 19
def container_id
return unless status?
status.container_id
end
|
#failed? ⇒ Boolean
57
58
59
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 57
def failed?
status&.failed?
end
|
#pending? ⇒ Boolean
45
46
47
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 45
def pending?
!complete?
end
|
#poll_id ⇒ Object
Also known as:
id
10
11
12
13
14
15
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 10
def poll_id
return @poll_id if instance_variable_defined?(:@poll_id)
return @poll_id = nil unless (uri = parsed_poll_url)
@poll_id = uri.path.split('/poll/').last
end
|
#status=(value) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 29
def status=(value)
case value
when NilClass
doc["status"] = nil
when Ecoportal::API::V2::S3::Files::PollStatus
doc["status"] = JSON.parse(value.to_json)
when Hash
doc["status"] = value
else
raise "Invalid set on status: Need nil, PollStatus or Hash; got #{value.class}"
end
remove_instance_variable("@status") if defined?(@status)
end
|
#status? ⇒ Boolean
25
26
27
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 25
def status?
!doc['status'].nil?
end
|
#success? ⇒ Boolean
53
54
55
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 53
def success?
status&.success?
end
|
#timeout? ⇒ Boolean
61
62
63
|
# File 'lib/ecoportal/api/v2/s3/files/poll.rb', line 61
def timeout?
status&.timeout?
end
|