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.



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

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

Instance Method Details

#joinObject



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

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