Module: MiGA::Dataset::Status
- Included in:
- MiGA::Dataset
- Defined in:
- lib/miga/dataset/status.rb
Overview
Helper module including specific functions for dataset status
Instance Method Summary collapse
-
#recalculate_status(save = true) ⇒ Object
Identify the current status and save it if
save
and the status changed. -
#status(save = false) ⇒ Object
Returns the status of the dataset.
Instance Method Details
#recalculate_status(save = true) ⇒ Object
Identify the current status and save it if save
and the status changed. Return symbols are the same as status
.
19 20 21 22 23 24 25 |
# File 'lib/miga/dataset/status.rb', line 19 def recalculate_status(save = true) old_status = [:status] [:status] = !active? ? 'inactive' : done_preprocessing? ? 'complete' : 'incomplete' self.save if save && (old_status.nil? || old_status != [:status]) [:status].to_sym end |
#status(save = false) ⇒ Object
Returns the status of the dataset. If the status is not yet defined, it recalculates it and, if save
is true, saves it in metadata. Return symbols are:
-
:inactive
The dataset is currently inactive -
:incomplete
The dataset is not yet fully processed -
:complete
The dataset is fully processed
11 12 13 14 |
# File 'lib/miga/dataset/status.rb', line 11 def status(save = false) recalculate_status(save) if [:status].nil? [:status].to_sym end |