Sha256: 8c3b5e6c035091a91b7ed51e4a11a1b77556a37dbe98dc697f9b39cea4b407ba

Contents?: true

Size: 614 Bytes

Versions: 32

Compression:

Stored size: 614 Bytes

Contents

module Sportradar
  module Api
    class Nfl::Position < Data
      attr_accessor :response, :name, :players

      def initialize(data)
        @response = data
        @name = data["name"]
        set_players
      end

      private

      def set_players
        if response["player"]
          if response["player"].is_a?(Array)
            @players = response["player"].map {|player| Sportradar::Api::Nfl::Player.new player }
          elsif response["player"].is_a?(Hash)
            @players = [ Sportradar::Api::Nfl::Player.new(response["player"]) ]
          end
        end
      end

    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

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