Class: RR::WildcardMatchers::IsA
- Inherits:
-
Object
- Object
- RR::WildcardMatchers::IsA
- Defined in:
- lib/rr/wildcard_matchers/is_a.rb
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) klass
readonly
Returns the value of attribute klass.
Instance Method Summary (collapse)
- - (Object) ==(other) (also: #eql?)
-
- (IsA) initialize(klass)
constructor
A new instance of IsA.
- - (Object) inspect
- - (Boolean) wildcard_match?(other)
Constructor Details
- (IsA) initialize(klass)
A new instance of IsA
6 7 8 |
# File 'lib/rr/wildcard_matchers/is_a.rb', line 6 def initialize(klass) @klass = klass end |
Instance Attribute Details
- (Object) klass (readonly)
Returns the value of attribute klass
4 5 6 |
# File 'lib/rr/wildcard_matchers/is_a.rb', line 4 def klass @klass end |
Instance Method Details
- (Object) ==(other) Also known as: eql?
18 19 20 21 |
# File 'lib/rr/wildcard_matchers/is_a.rb', line 18 def ==(other) return false unless other.is_a?(self.class) self.klass == other.klass end |
- (Object) inspect
14 15 16 |
# File 'lib/rr/wildcard_matchers/is_a.rb', line 14 def inspect "is_a(#{klass})" end |
- (Boolean) wildcard_match?(other)
10 11 12 |
# File 'lib/rr/wildcard_matchers/is_a.rb', line 10 def wildcard_match?(other) self == other || other.is_a?(klass) end |