Class: Rubygoal::Match

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygoal/match.rb

Defined Under Namespace

Classes: Team

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(my_score, other_score, time, other_formation) ⇒ Match

Returns a new instance of Match.



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/rubygoal/match.rb', line 27

def initialize(my_score, other_score, time, other_formation)
  @me = Match::Team.new(
    my_score,
    result(my_score, other_score)
  )
  @other = Match::Team.new(
    other_score,
    result(other_score, my_score),
    other_formation
  )
  @time = time
end

Instance Attribute Details

#meObject (readonly)

Returns the value of attribute me.



25
26
27
# File 'lib/rubygoal/match.rb', line 25

def me
  @me
end

#otherObject (readonly)

Returns the value of attribute other.



25
26
27
# File 'lib/rubygoal/match.rb', line 25

def other
  @other
end

#timeObject (readonly)

Returns the value of attribute time.



25
26
27
# File 'lib/rubygoal/match.rb', line 25

def time
  @time
end