Method: CodeBlock::Block#line_nums_to_s

Defined in:
lib/codeblock.rb

#line_nums_to_sObject

Builds the string that is returned by CodeBlock#line_nums_to_s.



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/codeblock.rb', line 467

def line_nums_to_s
	# $tm.hrm
	rv = []
	
	# get maximum width
	width = @lines[-1].number.to_s.length
	
	# loop through lines
	@lines.each do |line|
		rv.push line.number.to_s.rjust(width) + '.'
	end
	
	# return
	return rv.join("\n")
end