Sha256: b7883bd14937f6142512efc715939d9d84e74edc1af5601601984edfa8802711

Contents?: true

Size: 375 Bytes

Versions: 3

Compression:

Stored size: 375 Bytes

Contents

module Cartola
  class Round < RestModel
    properties :rodada_id,
               :inicio,
               :fim

    def self.find(id)
      self.find_all.find{ |r| r.rodada_id == id.to_s }
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cartola-0.1.4 lib/cartola/round.rb
cartola-0.1.3 lib/cartola/round.rb
cartola-0.1.2 lib/cartola/round.rb