Class: Jumbotron::Services::Public::ReadScheduleGroups
- Inherits:
-
CommandTower::Services::ApplicationService
- Object
- CommandTower::Services::ApplicationService
- Jumbotron::Services::Public::ReadScheduleGroups
- Defined in:
- app/services/jumbotron/services/public/read_schedule_groups.rb
Overview
Lists observed ScheduleGroups for a resolved SeasonPhase. Completeness is always :incomplete until a dedicated authoritative catalog exists.
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/jumbotron/services/public/read_schedule_groups.rb', line 11 def call league = resolve_league return if context.failure? if league.nil? not_found("league_not_found", "league was not found") return end season = resolve_season(league) return if context.failure? return if season.nil? phase = resolve_phase(season) return if context.failure? return if phase.nil? records = load_groups(season, phase) groups = records.map { |record| build_group(record) } context.schedule_groups = Jumbotron::Public::ScheduleGroupEnumeration.new( groups: groups, completeness: :incomplete ) end |