Class: TextExtractor::Directives::Begin

Inherits:
Directive
  • Object
show all
Defined in:
lib/text_extractor/directives/classes.rb

Overview

open a line group

Direct Known Subclasses

Any, Capture

Instance Attribute Summary

Attributes inherited from Directive

#state

Instance Method Summary collapse

Methods inherited from Directive

#initialize, #values

Constructor Details

This class inherits a constructor from TextExtractor::Directives::Directive

Instance Method Details

#callObject



38
39
40
41
# File 'lib/text_extractor/directives/classes.rb', line 38

def call
  state.current = nil
  state.groups.push @group
end

#group(*args) ⇒ Object



34
35
36
# File 'lib/text_extractor/directives/classes.rb', line 34

def group(*args)
  Group.new(*args)
end

#initObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/text_extractor/directives/classes.rb', line 22

def init
  type = case @argument
         when '', nil
           '?:'
         when '?:'
           ''
         else
           @argument
         end
  @group = group(type)
end