Sha256: f17dbbc989a1975d19410adc4fe09464fe49e2145ec277390223fe0b7b90ff13

Contents?: true

Size: 492 Bytes

Versions: 1

Compression:

Stored size: 492 Bytes

Contents

module MethodLog
  class MethodDefinition
    def initialize(source_file:, lines:)
      @source_file = source_file
      @lines = lines
    end

    def ==(other)
      (source_file == other.source_file) && (lines == other.lines)
    end

    def hash
      [source_file, lines].hash
    end

    def to_s
      [
        "#{source_file.path}:#{lines}",
        source_file.snippet(lines)
      ].join($/)
    end

    protected

    attr_reader :source_file
    attr_reader :lines
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
method_log-0.0.1 lib/method_log/method_definition.rb