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

Instance Method Details

#resultObject



73
74
75
# File 'lib/regexp-examples/groups.rb', line 73

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