class RR::WildcardMatchers::IsA

Attributes

klass[R]

Public Class Methods

new(klass) click to toggle source
# File lib/rr/wildcard_matchers/is_a.rb, line 6
def initialize(klass)
  @klass = klass
end

Public Instance Methods

==(other) click to toggle source
# File lib/rr/wildcard_matchers/is_a.rb, line 14
def ==(other)
  other.is_a?(self.class) && klass == other.klass
end
Also aliased as: eql?
eql?(other)
Alias for: ==
inspect() click to toggle source
# File lib/rr/wildcard_matchers/is_a.rb, line 19
def inspect
  "is_a(#{klass})"
end
wildcard_match?(other) click to toggle source
# File lib/rr/wildcard_matchers/is_a.rb, line 10
def wildcard_match?(other)
  self == other || other.is_a?(klass)
end