class Protocol::CheckFailed
This exception collects CheckError
exceptions and mixes in Enumerable for further processing of them.
Attributes
errors[R]
Public Class Methods
new(*errors)
click to toggle source
# File lib/protocol/errors.rb, line 60 def initialize(*errors) @errors = errors end
Public Instance Methods
<<(check_error)
click to toggle source
Add check_error
to this CheckFailed
instance.
# File lib/protocol/errors.rb, line 73 def <<(check_error) @errors << check_error self end
each_error(&block)
click to toggle source
Iterate over all errors of this CheckFailed
instance and pass each one to block
.
# File lib/protocol/errors.rb, line 80 def each_error(&block) errors.each(&block) end
Also aliased as: each
empty?()
click to toggle source
Return true, if this CheckFailed
doesn’t contain any errors (yet). Otherwise false is returned.
# File lib/protocol/errors.rb, line 68 def empty? errors.empty? end
inspect()
click to toggle source
# File lib/protocol/errors.rb, line 91 def inspect "#<#{self.class.name}: #{errors.map { |e| e.inspect} * '|'}" end
to_s()
click to toggle source
# File lib/protocol/errors.rb, line 87 def to_s errors * "|" end