lib/sportradar/api/nfl/team.rb in sportradar-api-0.1.32 vs lib/sportradar/api/nfl/team.rb in sportradar-api-0.1.33

- old
+ new

@@ -1,11 +1,11 @@ module Sportradar module Api class Nfl::Team < Data attr_accessor :response, :id, :name, :alias, :game_number, :defense, :special_teams, :offense, :players, :statistics, :team_records, :player_records, :market, :franchise, :venue, :hierarchy, :coaches, :players, :used_timeouts, :remaining_timeouts, :points, :wins, :losses, :ties, :win_pct, :rank, :stats - alias :score :points + alias_method :score, :points def initialize(data) @response = data @id = data["id"] @name = data["name"] @@ -63,9 +63,11 @@ if response["players"]["player"].is_a?(Array) @players = response["players"]["player"].map {|player| Sportradar::Api::Nfl::Player.new player } elsif response["players"]["player"].is_a?(Hash) @players = [ Sportradar::Api::Nfl::Player.new(response["players"]["player"]) ] end + else + @players = [] end end def set_coaches if response["coaches"] && response["coaches"]["coach"]