Sha256: 03eb05c0af8c637b8540ee5b372d9a468d6506b5778e20aa9c1ad614937bd576

Contents?: true

Size: 871 Bytes

Versions: 2

Compression:

Stored size: 871 Bytes

Contents

module Sportradar
  module Api
    class Nfl::TeamDepthChart < Data
      attr_accessor :response, :season

      # data.keys => ["offense", "defense", "special_teams", "name", "market", "alias", "id"]
      def initialize(data, season)
        @response = data
        @season = season
      end

      def offense
        @offense ||= Sportradar::Api::Nfl::DepthChart.new(response['offense'])
      end

      def defense
        @defense ||= Sportradar::Api::Nfl::DepthChart.new(response['defense'])
      end

      def special_teams
        @special_teams ||= Sportradar::Api::Nfl::DepthChart.new(response['special_teams'])
      end

      def team
        @team ||= Sportradar::Api::Nfl::Team.new(response).tap { |team| team.depth_chart = self }
      end

      private

      def set_charts
        [offense, defense, special_teams]
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sportradar-api-0.1.34 lib/sportradar/api/nfl/team_depth_chart.rb
sportradar-api-0.1.33 lib/sportradar/api/nfl/team_depth_chart.rb