class PairSee::Card

Attributes

card_name[R]
last_date[R]
number_of_commits[R]

Public Class Methods

new(card_name, commits) click to toggle source
# File lib/pair_see/card.rb, line 5
def initialize(card_name, commits)
  @card_name = card_name
  @number_of_commits = commits.count
  @first_date = commits.first.date
  @last_date = commits.last.date
end

Public Instance Methods

==(other) click to toggle source
# File lib/pair_see/card.rb, line 16
def ==(other)
  card_name == other.card_name
  number_of_commits == other.number_of_commits
end
duration() click to toggle source
# File lib/pair_see/card.rb, line 12
def duration
  (@last_date - @first_date).to_i + 1
end
pretty() click to toggle source
# File lib/pair_see/card.rb, line 21
def pretty
  commits_per_day = ((number_of_commits * 1.0) / duration).round(2)
  "#{card_name} - - - commits: #{number_of_commits} - - - duration: #{duration} days - - - last commit: #{last_date} - - - commits per day: #{commits_per_day}"
end