class Ashikawa::Core::Status

Wrapper around the status of a collection

Constants

MAX_UNCORRUPTED

Highest ArangoDB Status that means that the collection is not corrupted

STATUS_BEING_UNLOADED

ArangoDB Status for a collection that is being unloaded

STATUS_LOADED

ArangoDB Status for a collection that is loaded

STATUS_NEW_BORN

ArangoDB Status for a new born collection

STATUS_UNLOADED

ArangoDB Status for a collection that is unloaded

Public Class Methods

new(code) click to toggle source

Create a wrapper around a given status

@param [Fixnum] code @api public @example Create a new status

status = Ashikawa::Core::Status.new(3)
# File lib/ashikawa-core/status.rb, line 26
def initialize(code)
  @code = code
end

Public Instance Methods

being_unloaded?() click to toggle source

Checks if the collection is in the process of being unloaded

@return [Boolean] @api public @example Is the collection unloaded?

status = Ashikawa::Core::Status.new(3)
status.being_unloaded? #=> false
# File lib/ashikawa-core/status.rb, line 70
def being_unloaded?
  @code == STATUS_BEING_UNLOADED
end
corrupted?() click to toggle source

Checks if the collection is corrupted

@return [Boolean] @api public @example Is the collection corrupted?

status = Ashikawa::Core::Status.new(3)
status.corrupted? #=> false
# File lib/ashikawa-core/status.rb, line 81
def corrupted?
  @code > MAX_UNCORRUPTED
end
loaded?() click to toggle source

Checks if the collection is loaded

@return [Boolean] @api public @example Is the collection loaded?

status = Ashikawa::Core::Status.new(3)
status.loaded? #=> true
# File lib/ashikawa-core/status.rb, line 59
def loaded?
  @code == STATUS_LOADED
end
new_born?() click to toggle source

Checks if the collection is new born

@return [Boolean] @api public @example Is the collection new born?

status = Ashikawa::Core::Status.new(3)
status.new_born? #=> false
# File lib/ashikawa-core/status.rb, line 37
def new_born?
  @code == STATUS_NEW_BORN
end
unloaded?() click to toggle source

Checks if the collection is unloaded

@return [Boolean] @api public @example Is the collection unloaded?

status = Ashikawa::Core::Status.new(3)
status.unloaded? #=> false
# File lib/ashikawa-core/status.rb, line 48
def unloaded?
  @code == STATUS_UNLOADED
end