Class: Spoll::Models::Match

Inherits:
Base
  • Object
show all
Defined in:
lib/spoll/models/match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#set_array_relation, #set_relation

Instance Attribute Details

#away_teamObject

Returns the value of attribute away_team.



3
4
5
# File 'lib/spoll/models/match.rb', line 3

def away_team
  @away_team
end

#eventsObject

Returns the value of attribute events.



3
4
5
# File 'lib/spoll/models/match.rb', line 3

def events
  @events
end

#home_teamObject

Returns the value of attribute home_team.



3
4
5
# File 'lib/spoll/models/match.rb', line 3

def home_team
  @home_team
end

Instance Method Details

#set_relations(response) ⇒ Object



10
11
12
13
14
# File 'lib/spoll/models/match.rb', line 10

def set_relations(response)
  set_array_relation(:events, response.events, 'match_id', :id)
  set_relation(:home_team, response.teams, 'id', :home_team_id)
  set_relation(:away_team, response.teams, 'id', :away_team_id)
end