Class: Cartola::Round
- Inherits:
-
RestModel
- Object
- RestModel
- Cartola::Round
- Defined in:
- lib/cartola/round.rb
Class Method Summary collapse
Class Method Details
.find(id) ⇒ Object
7 8 9 |
# File 'lib/cartola/round.rb', line 7 def self.find(id) self.find_all.find{ |r| r.rodada_id == id.to_s } end |
.find_all ⇒ Object
11 12 13 14 15 |
# File 'lib/cartola/round.rb', line 11 def self.find_all response = RestClient.get 'https://api.cartolafc.globo.com/rodadas' json = JSON.parse response.body from_source(json) end |