Class: FootballApi::MatchInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/football_api/match_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ MatchInfo

Returns a new instance of MatchInfo.



6
7
8
9
10
11
12
# File 'lib/football_api/match_info.rb', line 6

def initialize(hash = {})
  @id           = hash[:id]
  @stadium_name = hash[:stadium][:name]    if hash[:stadium]
  @attendance   = hash[:attendance][:name] if hash[:attendance]
  @time         = hash[:time][:name]       if hash[:time]
  @referee      = hash[:referee][:name]    if hash[:referee]
end

Instance Attribute Details

#attendanceObject

Returns the value of attribute attendance.



4
5
6
# File 'lib/football_api/match_info.rb', line 4

def attendance
  @attendance
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/football_api/match_info.rb', line 4

def id
  @id
end

#refereeObject

Returns the value of attribute referee.



4
5
6
# File 'lib/football_api/match_info.rb', line 4

def referee
  @referee
end

#stadium_nameObject

Returns the value of attribute stadium_name.



4
5
6
# File 'lib/football_api/match_info.rb', line 4

def stadium_name
  @stadium_name
end

#timeObject

Returns the value of attribute time.



4
5
6
# File 'lib/football_api/match_info.rb', line 4

def time
  @time
end