Sha256: 5fbf0aa58d35e3a7368568f0e4e80da496216f1dd664e6488b8fbd5995fecbc6

Contents?: true

Size: 316 Bytes

Versions: 3

Compression:

Stored size: 316 Bytes

Contents

# frozen_string_literal: true

require "date"

module Gistory
  class Commit
    attr_reader :short_hash, :date

    def initialize(short_hash:, date:)
      @short_hash = short_hash
      @date = DateTime.parse(date.to_s)
      freeze
    end

    def to_s
      "Commit #{short_hash} on #{date}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gistory-0.4.0 lib/gistory/commit.rb
gistory-0.3.0 lib/gistory/commit.rb
gistory-0.2.1 lib/gistory/commit.rb