Sha256: d4c8fcb6da39597bf2ca06b5c80ebdfd300d2b21381bb2b85f77271ddbca5b59

Contents?: true

Size: 713 Bytes

Versions: 32

Compression:

Stored size: 713 Bytes

Contents

module Sportradar
  module Api
    class Nfl::Conference < Data
      attr_accessor :response, :id, :name, :alias, :divisions

      def initialize(data)
        @response = data
        @id = data["id"]
        @name = data["name"]
        @alias = data["alias"]
        set_divisions
      end

      private

      def set_divisions
        if response["division"]
          if response["division"].is_a?(Array)
            @divisions = response["division"].map {|division| Sportradar::Api::Nfl::Division.new division }
          elsif response["division"].is_a?(Hash)
            @divisions = [ Sportradar::Api::Nfl::Division.new(response["division"]) ]
          end
        end
      end

    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
sportradar-api-0.1.17 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.16 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.15 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.14 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.13 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.12 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.11 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.10 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.8 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.7 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.6 lib/sportradar/api/nfl/conference.rb
sportradar-api-0.1.5 lib/sportradar/api/nfl/conference.rb