Class: RegexpExamples::PlaceHolderGroup

Inherits:
Object
  • Object
show all
Includes:
RandomResultBySample
Defined in:
lib/regexp-examples/groups.rb

Overview

Used as a workaround for when a group is expected to be returned, but there are no results for the group. i.e. PlaceHolderGroup.new.result == ” == SingleCharGroup.new(”).result (But using PlaceHolderGroup makes it clearer what the intention is!)

Instance Method Summary collapse

Methods included from RandomResultBySample

#random_result

Methods included from ForceLazyEnumerators

#force_if_lazy

Instance Method Details

#resultObject



83
84
85
# File 'lib/regexp-examples/groups.rb', line 83

def result
  [GroupResult.new('')]
end