Class: MatchData

Inherits:
Object
  • Object
show all
Defined in:
lib/match_skeleton/match_data.rb

Overview

Class MatchData

Modifies the operator #== so it can be compared with MatchSkeleton.

Instance Method Summary collapse

Instance Method Details

#==(obj) ⇒ Boolean

Compares with MatchSkeleton, in addition to MatchData

Parameters:

  • All (#string, #regexp, #pre_match)

    the methods have to be there. Practically, MatchSkeleton and MatchData

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/match_skeleton/match_data.rb', line 16

def ==(obj)
  (string    == obj.string) &&
  (regexp    == obj.regexp) &&
  (pre_match == obj.pre_match)
end

#equal_before_match_skeletonObject

Backup alias for #==



10
# File 'lib/match_skeleton/match_data.rb', line 10

alias_method :equal_before_match_skeleton, :==