Sha256: 064f0351fb9b7b3dfd1a2d2285c188279c63f7ef2c0010965f36a2ddb302d119
Contents?: true
Size: 609 Bytes
Versions: 34
Compression:
Stored size: 609 Bytes
Contents
module Messaging class ExpectedVersion Error = Class.new(StandardError) attr_reader :version def initialize(version) @version = version end def any? version == :any end def none? version == :none || version == -1 end def matches?(other_version) return true if any? return true if none? && other_version == -1 return true if version == other_version false end def match!(other_version) return true if matches?(other_version) raise Error, "expected: #{version} actual: #{other_version}" end end end
Version data entries
34 entries across 34 versions & 1 rubygems