class FplGsheet::League

Attributes

id[R]
name[R]

Public Class Methods

new(league_id) click to toggle source
# File lib/fpl_gsheet/league.rb, line 5
def initialize(league_id)
  @league_data=JSON.load(open("https://fantasy.premierleague.com/api/leagues-classic/#{league_id}/standings/", {ssl_verify_mode: 0}))
  @name=@league_data['league']['name']
  @id=@league_data['league']['id']
  #@fixtures = fixtures.map { |f| TeamFixture.new(f, @data['id']) }
end

Public Instance Methods

standings() click to toggle source
# File lib/fpl_gsheet/league.rb, line 12
def standings
  @standings ||= @league_data['standings']['results']
end