Class: Fantasydata::Client

Constant Summary

Constants included from API::Utils

API::Utils::API_KEY_CANNOT_CALL_THIS_METHOD, API::Utils::INVALID_PARAMETER, API::Utils::MISSING_OR_INVALID_KEY, API::Utils::MISSING_PARAMETER, API::Utils::RATE_LIMIT_EXCEEDED, API::Utils::SUCCESS

Instance Attribute Summary

Attributes included from Configurable

#api_key, #connection_options, #endpoint, #middleware

Instance Method Summary collapse

Methods included from Configurable

#configure, #credentials?, keys, #reset!

Methods included from API::Week

#current_week, #last_completed_week, #upcoming_week

Methods included from API::Timeline

#all_timelines, #completed_timelines, #current_timeline, #recent_timelines, #upcoming_timelines

Methods included from API::Standings

#standings_by_year

Methods included from API::Stadium

#stadiums

Methods included from API::Schedule

#schedule_by_year

Methods included from API::Score

#scores_by_season, #scores_by_week

Methods included from API::Season

#current_season, #last_completed_season, #upcoming_season

Methods included from API::Team

#team_game_stats_by_season, #team_game_stats_by_year_and_week, #teams_active, #teams_by_year

Methods included from API::PlayerStat

#player_game_stat_by_player, #player_game_stat_by_player_projection, #player_game_stats_by_delta, #player_game_stats_by_week, #player_game_stats_by_week_and_team, #player_game_stats_by_week_and_team_projection, #player_season_stat_by_player_id, #player_season_stat_by_player_id_projection, #player_season_stat_by_team, #player_season_stat_by_team_projection, #player_season_stats_by_year_projection

Methods included from API::PlayerDetails

#player_details_available, #player_details_by_player_id, #player_details_by_team, #player_details_free_agents

Methods included from API::News

#news_by_player_id, #news_by_team, #news_recent

Methods included from API::LeagueLeaders

#league_leaders_by_season, #league_leaders_by_week

Methods included from API::Injury

#injuries_by_year_and_week, #injuries_by_year_week_team

Methods included from API::Fantasy

#daily_fantasy_defense_game_projected_stats, #daily_fantasy_defense_game_stats, #daily_fantasy_defense_season_projected_stats, #daily_fantasy_defense_season_stats, #daily_fantasy_players_for_day, #daily_fantasy_points_for_day, #fantasy_players_adp

Methods included from API::BoxScore

#box_score_by_team, #box_scores_active, #box_scores_by_week, #box_scores_delta, #box_scores_delta_current_week, #box_scores_final, #box_scores_live

Methods included from API::ByeWeeks

#bye_weeks_for_season

Methods included from API::Game

#game_stats_by_season, #game_stats_by_week, #games_in_progress?

Constructor Details

#initialize(options = {}) ⇒ Fantasydata::Client

Initializes a new Client object

Parameters:

  • options (Hash) (defaults to: {})


47
48
49
50
51
# File 'lib/fantasydata/client.rb', line 47

def initialize(options={})
  Fantasydata::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", options[key] || Fantasydata.instance_variable_get(:"@#{key}"))
  end
end

Instance Method Details

#get(path, params = {}) ⇒ Object

Perform an HTTP GET request



54
55
56
# File 'lib/fantasydata/client.rb', line 54

def get(path, params={})
  request(:get, path, params)
end