class Betterp::Source
Public Class Methods
new(source, base_path)
click to toggle source
# File lib/betterp/source.rb, line 5 def initialize(source, base_path) @source = source @base_path = base_path @path, @line_no, @method_info = source.split(':') end
Public Instance Methods
line_no()
click to toggle source
# File lib/betterp/source.rb, line 17 def line_no @line_no.to_i end
method_name()
click to toggle source
# File lib/betterp/source.rb, line 21 def method_name @method_info.partition('`').last.chomp("'") end
path()
click to toggle source
# File lib/betterp/source.rb, line 11 def path Pathname.new(@path).relative_path_from(Pathname.new(@base_path)).to_s rescue ArgumentError @path end