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
Constructor Details
#initialize(id) ⇒ BackReferenceGroup
Returns a new instance of BackReferenceGroup.
158 159 160 |
# File 'lib/regexp-examples/groups.rb', line 158 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
157 158 159 |
# File 'lib/regexp-examples/groups.rb', line 157 def id @id end |
Instance Method Details
#result ⇒ Object
162 163 164 |
# File 'lib/regexp-examples/groups.rb', line 162 def result [ GroupResult.new("__#{@id}__") ] end |