class TMSAPI::Resource::Sports
Public Class Methods
new(connection, options = {})
click to toggle source
Calls superclass method
TMSAPI::Resource::Base::new
# File lib/tmsapi/resource/sports.rb, line 10 def initialize(connection, options = {}) super(connection, "v1") end
Public Instance Methods
details(sports_id = 'all', params = nil)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 14 def details(sports_id = 'all', params = nil) params = {} unless params #Include organizations by defailt. params[:includeOrg] = true unless params[:includeOrg] get(details_path(sports_id), params).each do |sport| TMSAPI::Model::SportInfo.new sport end end
event_airings(sports_id = 'all', params)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 24 def event_airings(sports_id = 'all', params) params[:startDateTime] = Time.now.strftime("%Y-%m-%dT%H:%MZ") unless params[:startDateTime] get(event_airings_path(sports_id),params).each do |event| TMSAPI::Model::SportEvent.new event end end
nonevent_airings(sports_id = 'all', params)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 32 def nonevent_airings(sports_id = 'all', params) params[:startDateTime] = Time.now.strftime("%Y-%m-%dT%H:%MZ") unless params[:startDateTime] get(nonevent_airings_path(sports_id), params).each do |airing| TMSAPI::Model::Airing.new airing end end
organization_airings(organization_id, params)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 77 def organization_airings(organization_id, params) get(organization_airings_path(organization_id), params).each do |airing| TMSAPI::Model::Airing.new airing end end
organization_teams(organization_id, params = nil)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 48 def organization_teams(organization_id, params = nil) get(organization_teams_path(organization_id), params).each do |org| TMSAPI::Model::Organization.new org end end
team_airings(team_brand_id, params)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 69 def team_airings(team_brand_id, params) params[:startDateTime] = Time.now.strftime("%Y-%m-%dT%H:%MZ") unless params[:startDateTime] get(team_airings_path(team_brand_id), params).each do |airing| TMSAPI::Model::Airing.new airing end end
team_details(team_brand_id, params = nil)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 63 def team_details(team_brand_id, params = nil) get(team_details_path(team_brand_id), params).each do |team| TMSAPI::Model::Team.new team end end
universities(params = nil)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 40 def universities(params = nil) params = {} unless params get(universities_path, params).each do |university| TMSAPI::Model::University.new university end end
university_teams(university_id, params = nil)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 54 def university_teams(university_id, params = nil) params = {} unless params params[:includeTeam] = true unless params[:includeTeam] get(university_teams_path(university_id),params).each do |team| TMSAPI::Model::Team.new team end end
Private Instance Methods
base_path()
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 121 def base_path "sports" end
details_path(sports_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 85 def details_path(sports_id) "#{base_path}/#{sports_id}" end
event_airings_path(sports_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 89 def event_airings_path(sports_id) "#{details_path(sports_id)}/events/airings" end
nonevent_airings_path(sports_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 93 def nonevent_airings_path(sports_id) "#{details_path(sports_id)}/non-events/airings" end
organization_airings_path(organization_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 117 def organization_airings_path(organization_id) "#{organization_teams_path(organization_id)}/airings" end
organization_teams_path(organization_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 101 def organization_teams_path(organization_id) "#{base_path}/organizations/#{organization_id}" end
team_airings_path(team_brand_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 113 def team_airings_path(team_brand_id) "#{team_details_path(team_brand_id)}/airings" end
team_details_path(team_brand_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 109 def team_details_path(team_brand_id) "#{base_path}/teams/#{team_brand_id}" end
universities_path()
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 97 def universities_path "#{base_path}/universities" end
university_teams_path(university_id)
click to toggle source
# File lib/tmsapi/resource/sports.rb, line 105 def university_teams_path(university_id) "#{base_path}/universities/#{university_id}" end