Class: SportSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/sportdb/search.rb,
lib/sportdb/search.rb,
lib/sportdb/search/sport.rb

Overview

setup sport search apis

Defined Under Namespace

Classes: ClubSearch, EventSearch, EventSeasonSearch, GroundSearch, LeagueSearch, NationalTeamSearch, PlayerSearch, Search, TeamSearch

Instance Method Summary collapse

Constructor Details

#initialize(leagues:, national_teams:, clubs:, grounds:, events:, players:) ⇒ SportSearch

Returns a new instance of SportSearch.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/sportdb/search.rb', line 26

def initialize( leagues:,
                national_teams:,
                clubs:,
                grounds:,
                events:,
                players:
                )
    @leagues        = LeagueSearch.new( leagues )
    @national_teams = NationalTeamSearch.new( national_teams )
    @clubs          = ClubSearch.new( clubs )
    @events         = EventSearch.new( events )

    @grounds        = GroundSearch.new( grounds )

    @players        = PlayerSearch.new( players )

    ## virtual deriv ("composite") search services
    @teams          = TeamSearch.new( clubs:          @clubs,
                                      national_teams: @national_teams )
    @event_seasons  = EventSeasonSearch.new( events: @events )

end

Instance Method Details

#clubsObject



51
# File 'lib/sportdb/search.rb', line 51

def clubs()          @clubs; end

#countriesObject



60
61
62
63
64
65
66
# File 'lib/sportdb/search.rb', line 60

def countries
   puts
   puts "[WARN] do NOT use catalog.countries, deprecated!!!"
   puts "   please, switch to new world.countries search service"
   puts
   exit 1
end

#eventsObject



52
# File 'lib/sportdb/search.rb', line 52

def events()         @events; end

#groundsObject



53
# File 'lib/sportdb/search.rb', line 53

def grounds()         @grounds; end

#leaguesObject



49
# File 'lib/sportdb/search.rb', line 49

def leagues()        @leagues; end

#national_teamsObject



50
# File 'lib/sportdb/search.rb', line 50

def national_teams() @national_teams; end

#playersObject



55
# File 'lib/sportdb/search.rb', line 55

def players()        @players; end

#seasonsObject

note - virtual table



58
# File 'lib/sportdb/search.rb', line 58

def seasons()        @event_seasons; end

#teamsObject

note - virtual table



57
# File 'lib/sportdb/search.rb', line 57

def teams()          @teams; end