Sha256: 912b7d9101333a2bd0d374670f7cc3ccb93c658f12e931a204bf8129d1a275d8

Contents?: true

Size: 772 Bytes

Versions: 4

Compression:

Stored size: 772 Bytes

Contents

module MethodLog
  class MethodCommit
    attr_reader :method_definition

    def initialize(commit, method_definition)
      @commit = commit
      @method_definition = method_definition
    end

    def update(commit)
      @commit = commit
    end

    def ==(other)
      (commit == other.commit) && (method_definition == other.method_definition)
    end

    def hash
      [commit, method_definition].hash
    end

    def sha
      commit.sha
    end

    def author
      commit.author
    end

    def message
      commit.message
    end

    def method_source
      method_definition && method_definition.source + $/
    end

    def source_file
      method_definition && method_definition.source_file
    end

    protected

    attr_reader :commit
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
method_log-0.1.1 lib/method_log/method_commit.rb
method_log-0.1.0 lib/method_log/method_commit.rb
method_log-0.0.7 lib/method_log/method_commit.rb
method_log-0.0.6 lib/method_log/method_commit.rb