Class: MLB::Team

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/mlb/team.rb

Instance Method Summary collapse

Instance Method Details

#roster(season: Time.now.year) ⇒ Object



57
58
59
60
61
62
63
# File 'lib/mlb/team.rb', line 57

def roster(season: Time.now.year)
  params = {season:}
  query_string = URI.encode_www_form(params)
  response = CLIENT.get("teams/#{id}/roster?#{query_string}")
  roster = Roster.from_json(response)
  roster.roster
end