class Calyx::Format::Trace

Public Class Methods

new(match_symbol, filename, contents) click to toggle source
# File lib/calyx/format.rb, line 8
def initialize(match_symbol, filename, contents)
  @match_symbol = match_symbol
  @filename = Pathname.new(filename)
  @contents = contents
end

Public Instance Methods

absolute_path() click to toggle source
# File lib/calyx/format.rb, line 18
def absolute_path
  @filename.expand_path
end
lineno() click to toggle source
# File lib/calyx/format.rb, line 22
def lineno
  line_number = 0
  @contents.each_line do |line|
    line_number += 1
    return line_number if line =~ @match_symbol
  end
end
path() click to toggle source
# File lib/calyx/format.rb, line 14
def path
  @filename.basename
end