Class: RegexpExamples::CharGroup

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

Instance Attribute Summary

Attributes included from GroupWithIgnoreCase

#ignorecase

Instance Method Summary collapse

Methods included from RandomResultBySample

#random_result

Constructor Details

#initialize(chars, ignorecase) ⇒ CharGroup

Returns a new instance of CharGroup.



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

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

Instance Method Details

#resultObject



77
78
79
80
81
# File 'lib/regexp-examples/groups.rb', line 77

def result
  @chars.map do |result|
    GroupResult.new(result)
  end
end