mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add to_s methods for result types
This commit is contained in:
parent
82a4a15ba9
commit
c869e4fc9a
4 changed files with 20 additions and 0 deletions
|
@ -17,5 +17,10 @@ module Spectator
|
|||
value = yield self
|
||||
interface.error(value)
|
||||
end
|
||||
|
||||
# One-word descriptor of the result.
|
||||
def to_s(io)
|
||||
io << "error"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,5 +27,10 @@ module Spectator
|
|||
value = yield self
|
||||
interface.failure(value)
|
||||
end
|
||||
|
||||
# One-word descriptor of the result.
|
||||
def to_s(io)
|
||||
io << "fail"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,5 +16,10 @@ module Spectator
|
|||
value = yield self
|
||||
interface.pending(value)
|
||||
end
|
||||
|
||||
# One-word descriptor of the result.
|
||||
def to_s(io)
|
||||
io << "pending"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,5 +14,10 @@ module Spectator
|
|||
value = yield self
|
||||
interface.success(value)
|
||||
end
|
||||
|
||||
# One-word descriptor of the result.
|
||||
def to_s(io)
|
||||
io << "success"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue