Class: FootStatsSimulator::ApiController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- FootStatsSimulator::ApiController
- Defined in:
- app/controllers/foot_stats_simulator/api_controller.rb
Instance Method Summary collapse
- #championship ⇒ Object
- #championship_classification ⇒ Object
- #championship_match ⇒ Object
- #championship_round_match ⇒ Object
- #championship_teams ⇒ Object
- #live_match ⇒ Object
- #match_narration ⇒ Object
- #team_players ⇒ Object
Instance Method Details
#championship ⇒ Object
5 6 7 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 5 def championship render_foot_stats SimulatorChampionship.to_foot_stats end |
#championship_classification ⇒ Object
19 20 21 22 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 19 def championship_classification championship = SimulatorChampionship.find_by_source_id(params[:Campeonato]) render_foot_stats championship.classification.to_foot_stats end |
#championship_match ⇒ Object
24 25 26 27 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 24 def championship_match championship = SimulatorChampionship.find_by_source_id(params[:Campeonato]) render_foot_stats championship.simulator_matches.to_foot_stats end |
#championship_round_match ⇒ Object
29 30 31 32 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 29 def championship_round_match championship = SimulatorChampionship.find_by_source_id(params[:Campeonato]) render_foot_stats championship.simulator_matches.where(round: params[:Rodada]).to_foot_stats end |
#championship_teams ⇒ Object
9 10 11 12 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 9 def championship_teams championship = SimulatorChampionship.find_by_source_id params[:IdCampeonato] render_foot_stats championship.simulator_teams.to_foot_stats end |
#live_match ⇒ Object
34 35 36 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 34 def live_match render_foot_stats SimulatorMatch.find_by_source_id(params[:IdPartida]).to_foot_stats_live end |
#match_narration ⇒ Object
38 39 40 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 38 def match_narration render_foot_stats SimulatorMatch.find_by_source_id(params[:Partida]).to_foot_stats_narration end |
#team_players ⇒ Object
14 15 16 17 |
# File 'app/controllers/foot_stats_simulator/api_controller.rb', line 14 def team_players team = SimulatorTeam.find_by_source_id params[:Equipe] render_foot_stats team.simulator_players.to_foot_stats end |