Class: RegexpExamples::BackReferenceGroup

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RandomResultBySample

#random_result

Methods included from ForceLazyEnumerators

#force_if_lazy

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

#idObject (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

#resultObject



171
172
173
# File 'lib/regexp-examples/groups.rb', line 171

def result
  [GroupResult.new("__#{@id}__")]
end