Class: Ashikawa::Core::Status
- Inherits:
-
Object
- Object
- Ashikawa::Core::Status
- Defined in:
- lib/ashikawa-core/status.rb
Overview
Wrapper around the status of a collection
Constant Summary collapse
- STATUS_NEW_BORN =
ArangoDB Status for a new born collection
1
- STATUS_UNLOADED =
ArangoDB Status for a collection that is unloaded
2
- STATUS_LOADED =
ArangoDB Status for a collection that is loaded
3
- STATUS_BEING_UNLOADED =
ArangoDB Status for a collection that is being unloaded
4
- MAX_UNCORRUPTED =
Highest ArangoDB Status that means that the collection is not corrupted
5
Instance Method Summary collapse
-
#being_unloaded? ⇒ Boolean
Checks if the collection is in the process of being unloaded.
-
#corrupted? ⇒ Boolean
Checks if the collection is corrupted.
-
#initialize(code) ⇒ Status
constructor
Create a wrapper around a given status.
-
#loaded? ⇒ Boolean
Checks if the collection is loaded.
-
#new_born? ⇒ Boolean
Checks if the collection is new born.
-
#unloaded? ⇒ Boolean
Checks if the collection is unloaded.
Constructor Details
#initialize(code) ⇒ Status
Create a wrapper around a given status
27 28 29 |
# File 'lib/ashikawa-core/status.rb', line 27 def initialize(code) @code = code end |
Instance Method Details
#being_unloaded? ⇒ Boolean
Checks if the collection is in the process of being unloaded
71 72 73 |
# File 'lib/ashikawa-core/status.rb', line 71 def being_unloaded? @code == STATUS_BEING_UNLOADED end |
#corrupted? ⇒ Boolean
Checks if the collection is corrupted
82 83 84 |
# File 'lib/ashikawa-core/status.rb', line 82 def corrupted? @code > MAX_UNCORRUPTED end |
#loaded? ⇒ Boolean
Checks if the collection is loaded
60 61 62 |
# File 'lib/ashikawa-core/status.rb', line 60 def loaded? @code == STATUS_LOADED end |
#new_born? ⇒ Boolean
Checks if the collection is new born
38 39 40 |
# File 'lib/ashikawa-core/status.rb', line 38 def new_born? @code == STATUS_NEW_BORN end |
#unloaded? ⇒ Boolean
Checks if the collection is unloaded
49 50 51 |
# File 'lib/ashikawa-core/status.rb', line 49 def unloaded? @code == STATUS_UNLOADED end |