Class: Sportradar::Api::Football::StatPack::ExtraPoints

Inherits:
Sportradar::Api::Football::StatPack show all
Defined in:
lib/sportradar/api/football/stat_pack/extra_points.rb

Instance Attribute Summary collapse

Attributes inherited from Sportradar::Api::Football::StatPack

#id, #name, #player, #players, #position, #response, #yards

Instance Method Summary collapse

Methods inherited from Sportradar::Api::Football::StatPack

#initialize

Methods inherited from Data

#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data

Constructor Details

This class inherits a constructor from Sportradar::Api::Football::StatPack

Instance Attribute Details

#attemptsObject

Returns the value of attribute attempts.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def attempts
  @attempts
end

#blockedObject

Returns the value of attribute blocked.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def blocked
  @blocked
end

#defense_attemptsObject

Returns the value of attribute defense_attempts.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def defense_attempts
  @defense_attempts
end

#defense_successesObject

Returns the value of attribute defense_successes.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def defense_successes
  @defense_successes
end

#madeObject

Returns the value of attribute made.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def made
  @made
end

#pass_attemptsObject

Returns the value of attribute pass_attempts.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def pass_attempts
  @pass_attempts
end

#pass_successesObject

Returns the value of attribute pass_successes.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def pass_successes
  @pass_successes
end

#pctObject

Returns the value of attribute pct.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def pct
  @pct
end

#rush_attemptsObject

Returns the value of attribute rush_attempts.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def rush_attempts
  @rush_attempts
end

#rush_successesObject

Returns the value of attribute rush_successes.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def rush_successes
  @rush_successes
end

#turnover_successesObject

Returns the value of attribute turnover_successes.



4
5
6
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 4

def turnover_successes
  @turnover_successes
end

Instance Method Details

#set_statsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sportradar/api/football/stat_pack/extra_points.rb', line 6

def set_stats
  kick_data = response['kicks'] || response['totals'] || response
  @attempts = kick_data["attempts"] || kick_data["att"]
  @made     = kick_data["made"]
  @blocked  = kick_data["blocked"] || kick_data["blk"]
  @pct      = kick_data["pct"] || (@made.to_f / @attempts.to_i)
  if response['conversions']
    @pass_attempts      = response["pass_attempts"]
    @pass_successes     = response["pass_successes"]
    @rush_attempts      = response["rush_attempts"]
    @rush_successes     = response["rush_successes"]
    @defense_attempts   = response["defense_attempts"]
    @defense_successes  = response["defense_successes"]
    @turnover_successes = response["turnover_successes"]
  end
end