Class: TextExtractor::Directives::CaptureGroup

Inherits:
Group
  • Object
show all
Defined in:
lib/text_extractor/directives/group.rb

Overview

a line group that will be captured to a value

Instance Method Summary collapse

Methods inherited from Group

#<<, #chomp, #finish, #to_a

Constructor Details

#initialize(name, *args) ⇒ CaptureGroup

Returns a new instance of CaptureGroup.



49
50
51
52
# File 'lib/text_extractor/directives/group.rb', line 49

def initialize(name, *args)
  @name = name
  @lines = args
end

Instance Method Details

#joinObject



54
55
56
# File 'lib/text_extractor/directives/group.rb', line 54

def join
  ["(?<#{@name}>", *@lines, ')']
end