Sha256: a21c99a53c02d4dd8991b5f72ad5910382abc87e0027e0a55e7ff4d153c93bc9

Contents?: true

Size: 422 Bytes

Versions: 62

Compression:

Stored size: 422 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

62 entries across 58 versions & 9 rubygems

Version Path
rr-0.8.0 lib/rr/wildcard_matchers/boolean.rb
rr-0.7.1 lib/rr/wildcard_matchers/boolean.rb