Sha256: 0f596a7d76b1b40f0b0b900b98d1292fa829b66f41a8fc71db20090708724942

Contents?: true

Size: 491 Bytes

Versions: 11

Compression:

Stored size: 491 Bytes

Contents

require_relative "finds_foreign_caller"

module CutePrint
  # @api private
  class Location

    extend FindsForeignCaller

    def self.find
      path, line_number = nearest_foreign_caller.split(':')
      line_number = line_number.to_i
      new(path, line_number)
    end

    attr_reader :path
    attr_reader :line_number

    def initialize(path, line_number)
      @path = path
      @line_number = line_number
    end

    def filename
      File.basename(@path)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cute_print-1.4.0 lib/cute_print/location.rb
cute_print-1.3.0 lib/cute_print/location.rb
cute_print-1.2.0 lib/cute_print/location.rb
cute_print-1.1.4 lib/cute_print/location.rb
cute_print-1.1.3 lib/cute_print/location.rb
cute_print-1.1.2 lib/cute_print/location.rb
cute_print-1.1.1 lib/cute_print/location.rb
cute_print-1.1.0 lib/cute_print/location.rb
cute_print-1.0.1 lib/cute_print/location.rb
cute_print-1.0.0 lib/cute_print/location.rb
cute_print-0.4.0 lib/cute_print/location.rb