Class: AnyValue::StringMatching

Inherits:
AnyString show all
Defined in:
lib/any_value.rb

Instance Method Summary collapse

Methods inherited from AnyString

#to_str

Methods inherited from Anything

#^, #to_ary, #to_str

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

#inspectObject



161
162
163
# File 'lib/any_value.rb', line 161

def inspect
  "#<StringMatching #@pattern>"
end