Class: Marko::Markup::Parser::Origin

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

Instance Method Summary collapse

Instance Method Details

#headerObject



58
59
60
# File 'lib/marko/markup/parser.rb', line 58

def header
  @header ||= markup.lines.first
end

#levelObject



62
63
64
# File 'lib/marko/markup/parser.rb', line 62

def level
  @level ||= header.scan(/^#*/).first.size
end

#to_sObject



66
67
68
# File 'lib/marko/markup/parser.rb', line 66

def to_s
  "#{origin}:#{lineno.to_s.rjust(2,'0')} >> #{header}".strip
end