Class: Alvalaxia::Game

Inherits:
Object
  • Object
show all
Defined in:
lib/alvalaxia/game.rb

Overview

Contains needed info of a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date, opponent, competition) ⇒ Game

Returns a new instance of Game.



10
11
12
13
14
# File 'lib/alvalaxia/game.rb', line 10

def initialize(date, opponent, competition)
  @date = Time.parse(date.gsub('/', '-'))
  @opponent = opponent
  @competition = competition
end

Instance Attribute Details

#competitionObject

Returns the value of attribute competition.



8
9
10
# File 'lib/alvalaxia/game.rb', line 8

def competition
  @competition
end

#dateObject

Returns the value of attribute date.



8
9
10
# File 'lib/alvalaxia/game.rb', line 8

def date
  @date
end

#opponentObject

Returns the value of attribute opponent.



8
9
10
# File 'lib/alvalaxia/game.rb', line 8

def opponent
  @opponent
end