Class: PairSee::Card
- Inherits:
-
Object
- Object
- PairSee::Card
- Defined in:
- lib/pair_see/card.rb
Instance Attribute Summary collapse
-
#card_name ⇒ Object
readonly
Returns the value of attribute card_name.
-
#number_of_commits ⇒ Object
readonly
Returns the value of attribute number_of_commits.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #duration ⇒ Object
-
#initialize(card_name, number_of_commits, first_date, last_date) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(card_name, number_of_commits, first_date, last_date) ⇒ Card
Returns a new instance of Card.
5 6 7 8 9 |
# File 'lib/pair_see/card.rb', line 5 def initialize(card_name, number_of_commits, first_date, last_date) @card_name = card_name @number_of_commits = number_of_commits @first_date, @last_date = first_date, last_date end |
Instance Attribute Details
#card_name ⇒ Object (readonly)
Returns the value of attribute card_name.
3 4 5 |
# File 'lib/pair_see/card.rb', line 3 def card_name @card_name end |
#number_of_commits ⇒ Object (readonly)
Returns the value of attribute number_of_commits.
3 4 5 |
# File 'lib/pair_see/card.rb', line 3 def number_of_commits @number_of_commits end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 18 |
# File 'lib/pair_see/card.rb', line 15 def ==(other) card_name == other.card_name number_of_commits == other.number_of_commits end |
#duration ⇒ Object
11 12 13 |
# File 'lib/pair_see/card.rb', line 11 def duration (@first_date - @last_date).to_i + 1 end |