Skip to content

Commit

Permalink
Add file named game.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
IvonneBenitesRodriguez committed Nov 29, 2023
1 parent 196cdbd commit 3870fec
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions classes/game.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require_relative 'item'
require 'date'

class Game < Item
attr_accessor :publish_date, :multiplayer, :last_played_at

def initialize(publish_date, multiplayer, last_played_at)
super(publish_date)
@multiplayer = multiplayer
@last_played_at = last_played_at
end

def can_be_archived?
super && (Date.today - Date.parse(@last_played_at) > 2)
end
end

0 comments on commit 3870fec

Please sign in to comment.