Sha256: 2f214c5531293a788b0263cb89062f1fc1c7e3014cefec1ffbc8f836f0d5e4df

Contents?: true

Size: 407 Bytes

Versions: 3

Compression:

Stored size: 407 Bytes

Contents

require_relative "origin"

module Ray
  module Origin
    class OriginFactory
      def get_origin
        location = self.get_location

        Origin.new(
          location ? location.absolute_path: nil,
          location ? location.lineno : nil,
        )
      end

      def get_location
        caller_locations.find { |location| ! location.path.include? "ruby-ray/lib" }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-ray-0.4.1 lib/ray/origin/origin_factory.rb
ruby-ray-0.4.0 lib/ray/origin/origin_factory.rb
ruby-ray-0.3.0 lib/ray/origin/origin_factory.rb