Class: AsciidoctorDiagramLayout::ParseState
- Inherits:
-
Struct
- Object
- Struct
- AsciidoctorDiagramLayout::ParseState
- Defined in:
- lib/asciidoctor_diagram_layout/parser.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#lines ⇒ Object
Returns the value of attribute lines.
Instance Method Summary collapse
- #advance ⇒ Object
-
#initialize(lines) ⇒ ParseState
constructor
A new instance of ParseState.
- #more? ⇒ Boolean
- #peek ⇒ Object
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
#index ⇒ Object
Returns the value of attribute index
104 105 106 |
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 104 def index @index end |
#lines ⇒ Object
Returns the value of attribute lines
104 105 106 |
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 104 def lines @lines end |
Instance Method Details
#advance ⇒ Object
117 118 119 |
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 117 def advance self.index += 1 end |
#more? ⇒ Boolean
109 110 111 |
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 109 def more? index < lines.size end |
#peek ⇒ Object
113 114 115 |
# File 'lib/asciidoctor_diagram_layout/parser.rb', line 113 def peek lines[index] end |