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
Methods included from ForceLazyEnumerators
Constructor Details
#initialize(multiline) ⇒ DotGroup
Returns a new instance of DotGroup.
113 114 115 |
# File 'lib/regexp-examples/groups.rb', line 113 def initialize(multiline) @multiline = multiline end |
Instance Attribute Details
#multiline ⇒ Object (readonly)
Returns the value of attribute multiline.
112 113 114 |
# File 'lib/regexp-examples/groups.rb', line 112 def multiline @multiline end |
Instance Method Details
#result ⇒ Object
117 118 119 120 121 122 |
# File 'lib/regexp-examples/groups.rb', line 117 def result chars = multiline ? CharSets::Any : CharSets::AnyNoNewLine chars.lazy.map do |result| GroupResult.new(result) end end |