Sha256: c00fcfebd44208200719b8b0c6caa413330e8016a64f558fdd846215a63ae83c

Contents?: true

Size: 421 Bytes

Versions: 3

Compression:

Stored size: 421 Bytes

Contents

module RR
  module WildcardMatchers
    class Boolean
      def wildcard_match?(other)
        self == other || is_a_boolean?(other)
      end

      def ==(other)
        other.is_a?(self.class)
      end
      alias_method :eql?, :==

      def inspect
        'boolean'
      end

    protected
      def is_a_boolean?(subject)
        subject.is_a?(TrueClass) || subject.is_a?(FalseClass)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rr-1.0.5 lib/rr/wildcard_matchers/boolean.rb
rr-1.0.5.rc2 lib/rr/wildcard_matchers/boolean.rb
rr-1.0.5.rc1 lib/rr/wildcard_matchers/boolean.rb