lib/sportradar/api/nfl/team.rb in sportradar-api-0.1.25 vs lib/sportradar/api/nfl/team.rb in sportradar-api-0.1.26
- old
+ new
@@ -1,18 +1,24 @@
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
+ 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
def initialize(data)
@response = data
@id = data["id"]
@name = data["name"]
@alias = data["alias"]
@game_number = data["game_number"]
@market = data["market"]
+
+ # These come from boxscore summary
+ @used_timeouts = data["used_timeouts"]
+ @remaining_timeouts = data["remaining_timeouts"]
+ @points = data["points"]
+
@franchise = Sportradar::Api::Nfl::Franchise.new data["franchise"] if data["franchise"]
@venue = Sportradar::Api::Nfl::Venue.new data["venue"] if data["venue"]
@hierarchy = Sportradar::Api::Nfl::Hierarchy.new data["hierarchy"] if data["hierarchy"]
@defense = data["defense"]["position"].map {|position| Sportradar::Api::Nfl::Position.new position } if data["defense"] && data["defense"]["position"]
@@ -22,9 +28,13 @@
@team_records = OpenStruct.new data["team_records"] if data["team_records"] # TODO Implement better?
@player_records = OpenStruct.new data["player_records"] if data["player_records"] # TODO Implement better?
set_players
set_coaches
+ end
+
+ def full_name
+ [market, name].join(' ')
end
private
def set_players