Class: MLB::FreeAgents
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::FreeAgents
- Defined in:
- lib/mlb/free_agents.rb
Overview
Provides methods for fetching free agent data from the API
Instance Attribute Summary collapse
-
#free_agents ⇒ Array<FreeAgent>
Returns the free agents.
Class Method Summary collapse
-
.all(season: nil) ⇒ Array<FreeAgent>
Retrieves all free agents for a season.
Instance Attribute Details
Class Method Details
.all(season: nil) ⇒ Array<FreeAgent>
Retrieves all free agents for a season
28 29 30 31 32 |
# File 'lib/mlb/free_agents.rb', line 28 def self.all(season: nil) season ||= Utils.current_season response = CLIENT.get("people/freeAgents?#{Utils.build_query(season:)}") from_json(response).free_agents end |