class Async::Container::Threaded::Child::Status

A pseudo exit-status wrapper.

def as_json(...)

@returns [Boolean | String] If the status is an error, the error message is returned, otherwise `true`.

Convert the status to a hash, suitable for serialization.
def as_json(...)
	if @error
		@error.inspect
	else
		true
	end
end

def initialize(error = nil)

@parameter error [::Process::Status] The exit status of the child thread.
Initialise the status.
def initialize(error = nil)
	@error = error
end

def success?

@returns [Boolean]
Whether the status represents a successful outcome.
def success?
	@error.nil?
end

def to_s

A human readable representation of the status.
def to_s
	"\#<#{self.class} #{success? ? "success" : "failure"}>"
end