Class: RegexpExamples::DotGroup
- Inherits:
-
Object
- Object
- RegexpExamples::DotGroup
- Includes:
- RandomResultBySample
- Defined in:
- lib/regexp-examples/groups.rb
Overview
A special case of CharGroup, for the pattern /./ (For example, we never need to care about ignorecase here!)
Instance Attribute Summary collapse
-
#multiline ⇒ Object
readonly
Returns the value of attribute multiline.
Instance Method Summary collapse
-
#initialize(multiline) ⇒ DotGroup
constructor
A new instance of DotGroup.
- #result ⇒ Object
Methods included from RandomResultBySample
Constructor Details
#initialize(multiline) ⇒ DotGroup
Returns a new instance of DotGroup.
103 104 105 |
# File 'lib/regexp-examples/groups.rb', line 103 def initialize(multiline) @multiline = multiline end |
Instance Attribute Details
#multiline ⇒ Object (readonly)
Returns the value of attribute multiline.
102 103 104 |
# File 'lib/regexp-examples/groups.rb', line 102 def multiline @multiline end |
Instance Method Details
#result ⇒ Object
107 108 109 110 111 112 |
# File 'lib/regexp-examples/groups.rb', line 107 def result chars = multiline ? CharSets::Any : CharSets::AnyNoNewLine chars.lazy.map do |result| GroupResult.new(result) end end |