Class: NBA::LeagueDashPtStatsStat

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/nba/league_dash_pt_stats_stat.rb

Overview

Represents league-wide player or team speed and distance tracking statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ageFloat?

Returns the player’s age (for player mode)

Examples:

stat.age #=> 36.0

Returns:

  • (Float, nil)

    the player’s age



59
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 59

attribute :age, Shale::Type::Float

#avg_speedFloat?

Returns average speed

Examples:

stat.avg_speed #=> 4.25

Returns:

  • (Float, nil)

    average speed



131
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 131

attribute :avg_speed, Shale::Type::Float

#avg_speed_defFloat?

Returns average speed on defense

Examples:

stat.avg_speed_def #=> 4.35

Returns:

  • (Float, nil)

    average speed on defense



147
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 147

attribute :avg_speed_def, Shale::Type::Float

#avg_speed_offFloat?

Returns average speed on offense

Examples:

stat.avg_speed_off #=> 4.15

Returns:

  • (Float, nil)

    average speed on offense



139
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 139

attribute :avg_speed_off, Shale::Type::Float

#dist_feetFloat?

Returns distance traveled in feet

Examples:

stat.dist_feet #=> 12500.5

Returns:

  • (Float, nil)

    distance in feet



99
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 99

attribute :dist_feet, Shale::Type::Float

#dist_milesFloat?

Returns distance traveled in miles

Examples:

stat.dist_miles #=> 2.37

Returns:

  • (Float, nil)

    distance in miles



107
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 107

attribute :dist_miles, Shale::Type::Float

#dist_miles_defFloat?

Returns distance traveled on defense in miles

Examples:

stat.dist_miles_def #=> 1.22

Returns:

  • (Float, nil)

    distance on defense in miles



123
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 123

attribute :dist_miles_def, Shale::Type::Float

#dist_miles_offFloat?

Returns distance traveled on offense in miles

Examples:

stat.dist_miles_off #=> 1.15

Returns:

  • (Float, nil)

    distance on offense in miles



115
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 115

attribute :dist_miles_off, Shale::Type::Float

#gpInteger?

Returns games played

Examples:

stat.gp #=> 82

Returns:

  • (Integer, nil)

    games played



67
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 67

attribute :gp, Shale::Type::Integer

#lInteger?

Returns losses

Examples:

stat.l #=> 32

Returns:

  • (Integer, nil)

    losses



83
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 83

attribute :l, Shale::Type::Integer

#minFloat?

Returns minutes played

Examples:

stat.min #=> 32.5

Returns:

  • (Float, nil)

    minutes played



91
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 91

attribute :min, Shale::Type::Float

#player_idInteger?

Returns the player ID (for player mode)

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer, nil)

    the player’s ID



19
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 19

attribute :player_id, Shale::Type::Integer

#player_nameString?

Returns the player name (for player mode)

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String, nil)

    the player’s name



27
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 27

attribute :player_name, Shale::Type::String

#team_abbreviationString?

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String, nil)

    the team’s abbreviation



43
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 43

attribute :team_abbreviation, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team’s ID



35
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 35

attribute :team_id, Shale::Type::Integer

#team_nameString?

Returns the team name (for team mode)

Examples:

stat.team_name #=> "Golden State Warriors"

Returns:

  • (String, nil)

    the team’s name



51
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 51

attribute :team_name, Shale::Type::String

#wInteger?

Returns wins

Examples:

stat.w #=> 50

Returns:

  • (Integer, nil)

    wins



75
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 75

attribute :w, Shale::Type::Integer

Instance Method Details

#playerPlayer?

Returns the player

Examples:

stat.player #=> #<NBA::Player id=201939 ...>

Returns:

  • (Player, nil)

    the player object



155
156
157
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 155

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team

Examples:

stat.team #=> #<NBA::Team id=1610612744 ...>

Returns:

  • (Team, nil)

    the team object



165
166
167
# File 'lib/nba/league_dash_pt_stats_stat.rb', line 165

def team
  Teams.find(team_id)
end