Class: TextExtractor::State

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

Overview

class Expander

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeState

Returns a new instance of State.



126
127
128
129
130
# File 'lib/text_extractor/directives.rb', line 126

def initialize(*)
  super
  self.groups ||= []
  self.target ||= []
end

Instance Attribute Details

#currentObject

Returns the value of attribute current

Returns:

  • (Object)

    the current value of current



125
126
127
# File 'lib/text_extractor/directives.rb', line 125

def current
  @current
end

#current_lineObject

Returns the value of attribute current_line

Returns:

  • (Object)

    the current value of current_line



125
126
127
# File 'lib/text_extractor/directives.rb', line 125

def current_line
  @current_line
end

#groupsObject

Returns the value of attribute groups

Returns:

  • (Object)

    the current value of groups



125
126
127
# File 'lib/text_extractor/directives.rb', line 125

def groups
  @groups
end

#targetObject

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



125
126
127
# File 'lib/text_extractor/directives.rb', line 125

def target
  @target
end

Instance Method Details

#last_groupObject



132
133
134
# File 'lib/text_extractor/directives.rb', line 132

def last_group
  groups.last
end

#newline?Boolean

Returns:

  • (Boolean)


136
137
138
# File 'lib/text_extractor/directives.rb', line 136

def newline?
  current_line.end_with?("\n")
end