Module: Nfler::Teams

Defined in:
lib/nfler/teams.rb

Overview

NFL Teams

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.teamsObject

Returns the value of attribute teams.



8
9
10
# File 'lib/nfler/teams.rb', line 8

def teams
  @teams
end

Class Method Details

.getArray

Fetches the Wikipedia NFL page and parse teams

Returns:

  • (Array)

    NFL active Teams collection



13
14
15
16
17
# File 'lib/nfler/teams.rb', line 13

def get
  page = Nfler::Page.get 'http://en.wikipedia.org/wiki/NFL'
  doc = Nokogiri.parse(page)
  parse_teams doc.css('table.navbox.wikitable tr')
end