Class: Cartola::Sponsor

Inherits:
RestModel
  • Object
show all
Defined in:
lib/cartola/sponsor.rb

Class Method Summary collapse

Class Method Details

.find(id) ⇒ Object



16
17
18
# File 'lib/cartola/sponsor.rb', line 16

def self.find(id)
  self.find_all.find{ |l| l.liga_editorial_id == id.to_s }
end

.find_allObject



20
21
22
23
24
# File 'lib/cartola/sponsor.rb', line 20

def self.find_all
  response = RestClient.get 'https://api.cartolafc.globo.com/patrocinadores'
  json = JSON.parse response.body
  from_source(json)
end