Class: Asciidoctor::Reader::Cursor
- Inherits:
-
Object
- Object
- Asciidoctor::Reader::Cursor
- Defined in:
- lib/asciidoctor/reader.rb
Instance Attribute Summary collapse
- #dir ⇒ Object readonly
- #file ⇒ Object readonly
- #lineno ⇒ Object readonly
- #path ⇒ Object readonly
Instance Method Summary collapse
- #advance(num) ⇒ Object
-
#initialize(file, dir = nil, path = nil, lineno = 1) ⇒ Cursor
constructor
A new instance of Cursor.
- #line_info ⇒ Object (also: #to_s)
Constructor Details
#initialize(file, dir = nil, path = nil, lineno = 1) ⇒ Cursor
Returns a new instance of Cursor.
10 11 12 |
# File 'lib/asciidoctor/reader.rb', line 10 def initialize file, dir = nil, path = nil, lineno = 1 @file, @dir, @path, @lineno = file, dir, path, lineno end |
Instance Attribute Details
#dir ⇒ Object (readonly)
8 9 10 |
# File 'lib/asciidoctor/reader.rb', line 8 def dir @dir end |
#file ⇒ Object (readonly)
8 9 10 |
# File 'lib/asciidoctor/reader.rb', line 8 def file @file end |
#lineno ⇒ Object (readonly)
8 9 10 |
# File 'lib/asciidoctor/reader.rb', line 8 def lineno @lineno end |
#path ⇒ Object (readonly)
8 9 10 |
# File 'lib/asciidoctor/reader.rb', line 8 def path @path end |
Instance Method Details
#advance(num) ⇒ Object
14 15 16 |
# File 'lib/asciidoctor/reader.rb', line 14 def advance num @lineno += num end |
#line_info ⇒ Object Also known as: to_s
18 19 20 |
# File 'lib/asciidoctor/reader.rb', line 18 def line_info %(#{@path}: line #{@lineno}) end |