Class: RegexpExamples::BackReferenceGroup
- Inherits:
-
Object
- Object
- RegexpExamples::BackReferenceGroup
- Includes:
- RandomResultBySample
- Defined in:
- lib/regexp-examples/groups.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id) ⇒ BackReferenceGroup
constructor
A new instance of BackReferenceGroup.
- #result ⇒ Object
Methods included from RandomResultBySample
Methods included from ForceLazyEnumerators
Constructor Details
#initialize(id) ⇒ BackReferenceGroup
Returns a new instance of BackReferenceGroup.
167 168 169 |
# File 'lib/regexp-examples/groups.rb', line 167 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
166 167 168 |
# File 'lib/regexp-examples/groups.rb', line 166 def id @id end |
Instance Method Details
#result ⇒ Object
171 172 173 |
# File 'lib/regexp-examples/groups.rb', line 171 def result [GroupResult.new("__#{@id}__")] end |