Method: RDoc::Markdown::Literals#get_line

Defined in:
lib/rdoc/markdown/literals.rb

#get_line(no) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
# File 'lib/rdoc/markdown/literals.rb', line 100

def get_line(no)
  loff = position_line_offsets
  if no < 0
    raise "Line No is out of range: #{no} < 0"
  elsif no >= loff.size
    raise "Line No is out of range: #{no} >= #{loff.size}"
  end
  lend = loff[no]-1
  lstart = no > 0 ? loff[no-1] : 0
  string[lstart..lend]
end