Sha256: 3f3fde019459741da830edfb3c2cb0406db6a4df3f6386be5c4c00f86c6337fc

Contents?: true

Size: 664 Bytes

Versions: 16

Compression:

Stored size: 664 Bytes

Contents

module Sportradar
  module Api
    class Nfl::Week < Data
      attr_accessor :response, :id, :sequence, :title, :games


      def initialize(data)
        @response = data
        @id = data["id"]
        @sequence = data["sequence"]
        @title = data["title"]
        set_games
      end

      private

      def set_games
        if response["game"]
          if response["game"].is_a?(Array)
            @games = response["game"].map {|game| Sportradar::Api::Nfl::Game.new game }
          elsif response["game"].is_a?(Hash)
            @games = [ Sportradar::Api::Nfl::Game.new(response["game"]) ]
          end
        end
      end

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sportradar-api-0.1.38 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.37 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.36 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.35 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.34 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.33 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.32 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.31 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.30 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.29 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.28 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.27 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.26 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.25 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.24 lib/sportradar/api/nfl/week.rb
sportradar-api-0.1.23 lib/sportradar/api/nfl/week.rb