Class: AsciidoctorDiagramLayout::ParseState

Inherits:
Struct
  • Object
show all
Defined in:
lib/asciidoctor_diagram_layout/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lines) ⇒ ParseState

Returns a new instance of ParseState.



105
106
107
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 105

def initialize(lines)
  super(lines, 0)
end

Instance Attribute Details

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



104
105
106
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 104

def index
  @index
end

#linesObject

Returns the value of attribute lines

Returns:

  • (Object)

    the current value of lines



104
105
106
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 104

def lines
  @lines
end

Instance Method Details

#advanceObject



117
118
119
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 117

def advance
  self.index += 1
end

#more?Boolean

Returns:

  • (Boolean)


109
110
111
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 109

def more?
  index < lines.size
end

#peekObject



113
114
115
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 113

def peek
  lines[index]
end