Class: Hecks::Bluebook::Expression::Resolver::MatchesRegex

Inherits:
Struct
  • Object
show all
Defined in:
lib/hecks/bluebook/expression/resolver.rb

Overview

receiver.match?(/pattern/) -- vendored addition, not (yet) upstream hecks (migration plan task 8): confirmed the SINGLE most impactful corpus-wide dispatch-time gap of the whole migration -- .match?(regex) appears in nearly every value_object's format-validation rule across every corpus this migration touched (email/phone/ISO-8601-timestamp/zip patterns, dozens of files), and had NO parse support at all: it fell all the way through to the Lookup catch-all below, which tried to split the ENTIRE ".match?(/\A\d5\z/)" text on "." as if it were a dotted attribute path, and crashed with an opaque "no implicit conversion of Symbol into Integer" somewhere downstream -- confirmed live via a real dispatch, not validate (validate never evaluates a predicate body). receiver still needs its own parse (it may itself be a dotted lookup, e.g. some_field.match?(...)), the pattern text is taken as-is between the slashes (a Ruby Regexp literal, not the evaluator's own mini-grammar -- there is nothing to recurse into).

Instance Attribute Summary collapse

Instance Attribute Details

#flagsObject

Returns the value of attribute flags

Returns:

  • (Object)

    the current value of flags



79
80
81
# File 'lib/hecks/bluebook/expression/resolver.rb', line 79

def flags
  @flags
end

#patternObject

Returns the value of attribute pattern

Returns:

  • (Object)

    the current value of pattern



79
80
81
# File 'lib/hecks/bluebook/expression/resolver.rb', line 79

def pattern
  @pattern
end

#receiverObject

Returns the value of attribute receiver

Returns:

  • (Object)

    the current value of receiver



79
80
81
# File 'lib/hecks/bluebook/expression/resolver.rb', line 79

def receiver
  @receiver
end