Module: Englishest::Regexp

Defined in:
lib/englishest.rb

Constant Summary collapse

ALIASES =

List of aliases provided for each instance method indexed by its identifier

{
  "=~": i[hit index_of_first_matching],
  # As a reminder the tilde implicitely match against +$LAST_READ_LINE+
  # (aka +$_+).
  #
  # Ruby allows to call it both in suffixed and prefixed form, that is
  # +some_regexp.~+ and +~some_regexp+.
  #
  # Note that these aliases cover only the case of a method call suffixing a
  # Regexp object, like +some_regexp.index_of_first_hot_matching+. For a
  # prefixed method expression form, see +Englishest#spot+ bellow.
  "~": i[hit_tacitely index_of_first_hot_matching hot
          index_of_first_matching_on_last_read_line]
}.freeze