Class: NBA::InfographicFanDuelPlayerStat

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

Overview

Represents FanDuel infographic statistics for a player in a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns the assists

Examples:

stat.ast #=> 8

Returns:

  • (Integer)

    assists



215
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 215

attribute :ast, Shale::Type::Integer

#blkInteger

Returns the blocks

Examples:

stat.blk #=> 0

Returns:

  • (Integer)

    blocks



239
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 239

attribute :blk, Shale::Type::Integer

#blkaInteger

Returns the blocked attempts

Examples:

stat.blka #=> 1

Returns:

  • (Integer)

    blocked attempts



247
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 247

attribute :blka, Shale::Type::Integer

#drebInteger

Returns the defensive rebounds

Examples:

stat.dreb #=> 5

Returns:

  • (Integer)

    defensive rebounds



199
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 199

attribute :dreb, Shale::Type::Integer

#fan_duel_ptsFloat

Returns the FanDuel fantasy points

Examples:

stat.fan_duel_pts #=> 52.3

Returns:

  • (Float)

    FanDuel points



87
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 87

attribute :fan_duel_pts, Shale::Type::Float

#fg3_pctFloat

Returns the three-point percentage

Examples:

stat.fg3_pct #=> 0.455

Returns:

  • (Float)

    three-point percentage



159
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 159

attribute :fg3_pct, Shale::Type::Float

#fg3aInteger

Returns the three-pointers attempted

Examples:

stat.fg3a #=> 11

Returns:

  • (Integer)

    three-pointers attempted



151
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 151

attribute :fg3a, Shale::Type::Integer

#fg3mInteger

Returns the three-pointers made

Examples:

stat.fg3m #=> 5

Returns:

  • (Integer)

    three-pointers made



143
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 143

attribute :fg3m, Shale::Type::Integer

#fg_pctFloat

Returns the field goal percentage

Examples:

stat.fg_pct #=> 0.500

Returns:

  • (Float)

    field goal percentage



135
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 135

attribute :fg_pct, Shale::Type::Float

#fgaInteger

Returns the field goals attempted

Examples:

stat.fga #=> 20

Returns:

  • (Integer)

    field goals attempted



127
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 127

attribute :fga, Shale::Type::Integer

#fgmInteger

Returns the field goals made

Examples:

stat.fgm #=> 10

Returns:

  • (Integer)

    field goals made



119
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 119

attribute :fgm, Shale::Type::Integer

#ft_pctFloat

Returns the free throw percentage

Examples:

stat.ft_pct #=> 0.833

Returns:

  • (Float)

    free throw percentage



183
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 183

attribute :ft_pct, Shale::Type::Float

#ftaInteger

Returns the free throws attempted

Examples:

stat.fta #=> 6

Returns:

  • (Integer)

    free throws attempted



175
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 175

attribute :fta, Shale::Type::Integer

#ftmInteger

Returns the free throws made

Examples:

stat.ftm #=> 5

Returns:

  • (Integer)

    free throws made



167
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 167

attribute :ftm, Shale::Type::Integer

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400001"

Returns:

  • (String)

    the game ID



15
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 15

attribute :game_id, Shale::Type::String

#jersey_numString

Returns the jersey number

Examples:

stat.jersey_num #=> "30"

Returns:

  • (String)

    the jersey number



63
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 63

attribute :jersey_num, Shale::Type::String

#locationString

Returns the location (home/away)

Examples:

stat.location #=> "Home"

Returns:

  • (String)

    the location



79
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 79

attribute :location, Shale::Type::String

#minFloat

Returns the minutes played

Examples:

stat.min #=> 34.5

Returns:

  • (Float)

    minutes



111
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 111

attribute :min, Shale::Type::Float

#nba_fantasy_ptsFloat

Returns the NBA fantasy points

Examples:

stat.nba_fantasy_pts #=> 48.5

Returns:

  • (Float)

    NBA fantasy points



95
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 95

attribute :nba_fantasy_pts, Shale::Type::Float

#orebInteger

Returns the offensive rebounds

Examples:

stat.oreb #=> 1

Returns:

  • (Integer)

    offensive rebounds



191
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 191

attribute :oreb, Shale::Type::Integer

#pfInteger

Returns the personal fouls

Examples:

stat.pf #=> 2

Returns:

  • (Integer)

    personal fouls



255
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 255

attribute :pf, Shale::Type::Integer

#pfdInteger

Returns the personal fouls drawn

Examples:

stat.pfd #=> 4

Returns:

  • (Integer)

    personal fouls drawn



263
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 263

attribute :pfd, Shale::Type::Integer

#player_idInteger

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer)

    the player ID



23
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 23

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String)

    the player name



31
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 31

attribute :player_name, Shale::Type::String

#player_positionString

Returns the player position

Examples:

stat.player_position #=> "G"

Returns:

  • (String)

    the player position



71
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 71

attribute :player_position, Shale::Type::String

#plus_minusInteger

Returns the plus/minus

Examples:

stat.plus_minus #=> 15

Returns:

  • (Integer)

    plus/minus



279
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 279

attribute :plus_minus, Shale::Type::Integer

#ptsInteger

Returns the points scored

Examples:

stat.pts #=> 30

Returns:

  • (Integer)

    points



271
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 271

attribute :pts, Shale::Type::Integer

#rebInteger

Returns the total rebounds

Examples:

stat.reb #=> 6

Returns:

  • (Integer)

    total rebounds



207
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 207

attribute :reb, Shale::Type::Integer

#stlInteger

Returns the steals

Examples:

stat.stl #=> 2

Returns:

  • (Integer)

    steals



231
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 231

attribute :stl, Shale::Type::Integer

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String)

    the team abbreviation



55
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 55

attribute :team_abbreviation, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer)

    the team ID



39
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 39

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

stat.team_name #=> "Warriors"

Returns:

  • (String)

    the team name



47
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 47

attribute :team_name, Shale::Type::String

#tovInteger

Returns the turnovers

Examples:

stat.tov #=> 3

Returns:

  • (Integer)

    turnovers



223
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 223

attribute :tov, Shale::Type::Integer

#usg_pctFloat

Returns the usage percentage

Examples:

stat.usg_pct #=> 0.312

Returns:

  • (Float)

    usage percentage



103
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 103

attribute :usg_pct, Shale::Type::Float

Instance Method Details

#gameGame?

Returns the game object

Examples:

stat.game #=> #<NBA::Game>

Returns:

  • (Game, nil)

    the game object



307
308
309
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 307

def game
  Games.find(game_id)
end

#playerPlayer?

Returns the player object

Examples:

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

Returns:

  • (Player, nil)

    the player object



287
288
289
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 287

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



297
298
299
# File 'lib/nba/infographic_fan_duel_player_stat.rb', line 297

def team
  Teams.find(team_id)
end