Class: Duracloud::BitIntegrityReport
- Inherits:
-
Object
- Object
- Duracloud::BitIntegrityReport
show all
- Includes:
- TSV
- Defined in:
- lib/duracloud/bit_integrity_report.rb
Constant Summary
collapse
- SUCCESS =
"SUCCESS".freeze
- FAILURE =
"FAILURE".freeze
"Bit-Integrity-Report-Completion-Date".freeze
"Bit-Integrity-Report-Result".freeze
Constants included
from TSV
TSV::CHUNK_SIZE
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from TSV
#csv, #load_tsv, #load_tsv_file, #rows, #table, #to_s, #tsv_source, #tsv_source?
Constructor Details
#initialize(space_id, store_id = nil) ⇒ BitIntegrityReport
Returns a new instance of BitIntegrityReport.
15
16
17
18
19
|
# File 'lib/duracloud/bit_integrity_report.rb', line 15
def initialize(space_id, store_id = nil)
@space_id = space_id
@store_id = store_id
@report, @properties = nil, nil
end
|
Instance Attribute Details
#space_id ⇒ Object
Returns the value of attribute space_id.
13
14
15
|
# File 'lib/duracloud/bit_integrity_report.rb', line 13
def space_id
@space_id
end
|
#store_id ⇒ Object
Returns the value of attribute store_id.
13
14
15
|
# File 'lib/duracloud/bit_integrity_report.rb', line 13
def store_id
@store_id
end
|
Instance Method Details
#completion_date ⇒ Object
25
26
27
|
# File 'lib/duracloud/bit_integrity_report.rb', line 25
def completion_date
DateTime.parse(properties[COMPLETION_DATE_HEADER].first)
end
|
#properties ⇒ Object
45
46
47
|
# File 'lib/duracloud/bit_integrity_report.rb', line 45
def properties
@properties ||= fetch_properties
end
|
#report ⇒ Object
37
38
39
|
# File 'lib/duracloud/bit_integrity_report.rb', line 37
def report
@report ||= fetch_report
end
|
#report_loaded? ⇒ Boolean
41
42
43
|
# File 'lib/duracloud/bit_integrity_report.rb', line 41
def report_loaded?
!@report.nil?
end
|
#result ⇒ Object
29
30
31
|
# File 'lib/duracloud/bit_integrity_report.rb', line 29
def result
properties[RESULT_HEADER].first
end
|
#success? ⇒ Boolean
33
34
35
|
# File 'lib/duracloud/bit_integrity_report.rb', line 33
def success?
result == SUCCESS
end
|
#tsv ⇒ Object
21
22
23
|
# File 'lib/duracloud/bit_integrity_report.rb', line 21
def tsv
super || report.body
end
|