Sha256: a1aea527de6608273fd1f1ddd6d0c5ed39f01c166170de0768695a42bf9e5cff

Contents?: true

Size: 503 Bytes

Versions: 4

Compression:

Stored size: 503 Bytes

Contents

module FplGsheet
  class League
    attr_reader :name, :id
    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

    def standings
      @standings ||= @league_data['standings']['results']
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fpl_gsheet-0.3.2 lib/fpl_gsheet/league.rb
fpl_gsheet-0.3.1 lib/fpl_gsheet/league.rb
fpl_gsheet-0.3.0 lib/fpl_gsheet/league.rb
fpl_gsheet-0.2.0 lib/fpl_gsheet/league.rb