Sha256: 452d866db4c0cf6804e1117392a1e3d1e956a7f253d9a0f4a6f0cf60c959e71a
Contents?: true
Size: 832 Bytes
Versions: 7
Compression:
Stored size: 832 Bytes
Contents
module SoberSwag module Reporting module Report ## # Models either one set of errors or another. # Will enumerate them in order with #each_error class Either < Base def initialize(lhs, rhs) @lhs = lhs @rhs = rhs end ## # @return [Base] left reports attr_reader :lhs ## # @return [Base] right reports attr_reader :rhs # rubocop:disable Style/ExplicitBlockArgument def each_error return enum_for(:each_error) unless block_given? lhs.each_error do |key, value| yield key, value end rhs.each_error do |key, value| yield key, value end end # rubocop:enable Style/ExplicitBlockArgument end end end end
Version data entries
7 entries across 7 versions & 1 rubygems