Class: RegexpExamples::SingleCharGroup

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

Overview

The most “basic” possible group. For example, /x/ contains one SingleCharGroup

Instance Attribute Summary

Attributes included from GroupWithIgnoreCase

#ignorecase

Instance Method Summary collapse

Methods included from RandomResultBySample

#random_result

Methods included from ForceLazyEnumerators

#force_if_lazy

Constructor Details

#initialize(char, ignorecase) ⇒ SingleCharGroup

Returns a new instance of SingleCharGroup.



66
67
68
69
# File 'lib/regexp-examples/groups.rb', line 66

def initialize(char, ignorecase)
  @char = char
  @ignorecase = ignorecase
end

Instance Method Details

#resultObject



71
72
73
# File 'lib/regexp-examples/groups.rb', line 71

def result
  [GroupResult.new(@char)]
end