Class: AnyValue::StringMatching
- Defined in:
- lib/any_value.rb
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize(pattern) ⇒ StringMatching
constructor
A new instance of StringMatching.
- #inspect ⇒ Object
Methods inherited from AnyString
Methods inherited from Anything
Constructor Details
#initialize(pattern) ⇒ StringMatching
Returns a new instance of StringMatching.
152 153 154 155 |
# File 'lib/any_value.rb', line 152 def initialize(pattern) super @pattern = pattern end |
Instance Method Details
#==(o) ⇒ Object
157 158 159 |
# File 'lib/any_value.rb', line 157 def ==(o) super && o =~ @pattern end |
#inspect ⇒ Object
161 162 163 |
# File 'lib/any_value.rb', line 161 def inspect "#<StringMatching #@pattern>" end |