Sha256: 682bc7e6ffb8f48c60b7328e2a955a2cc60ee4c4a3c548731af7daa20a873112

Contents?: true

Size: 345 Bytes

Versions: 30

Compression:

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

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

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rr-0.1.10 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.14 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.15 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.11 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.8 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.13 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.12 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.7 lib/rr/wildcard_matchers/boolean.rb
rr-0.3.10 lib/rr/wildcard_matchers/boolean.rb
rr-0.2.3 lib/rr/wildcard_matchers/boolean.rb
rr-0.3.1 lib/rr/wildcard_matchers/boolean.rb
rr-0.2.5 lib/rr/wildcard_matchers/boolean.rb
rr-0.3.2 lib/rr/wildcard_matchers/boolean.rb
rr-0.3.3 lib/rr/wildcard_matchers/boolean.rb
rr-0.1.9 lib/rr/wildcard_matchers/boolean.rb
rr-0.2.1 lib/rr/wildcard_matchers/boolean.rb
rr-0.2.2 lib/rr/wildcard_matchers/boolean.rb
rr-0.3.0 lib/rr/wildcard_matchers/boolean.rb
rr-0.3.11 lib/rr/wildcard_matchers/boolean.rb
rr-0.3.4 lib/rr/wildcard_matchers/boolean.rb