Class: NBA::FantasyProfileStat

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

Overview

Represents a player’s fantasy profile statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astFloat?

Returns assists per game

Examples:

stat.ast #=> 6.1

Returns:

  • (Float, nil)

    assists per game



82
# File 'lib/nba/fantasy_profile_stat.rb', line 82

attribute :ast, Shale::Type::Float

#blkFloat?

Returns blocks per game

Examples:

stat.blk #=> 0.3

Returns:

  • (Float, nil)

    blocks per game



122
# File 'lib/nba/fantasy_profile_stat.rb', line 122

attribute :blk, Shale::Type::Float

#fan_duel_ptsFloat?

Returns FanDuel fantasy points

Examples:

stat.fan_duel_pts #=> 45.2

Returns:

  • (Float, nil)

    FanDuel fantasy points



50
# File 'lib/nba/fantasy_profile_stat.rb', line 50

attribute :fan_duel_pts, Shale::Type::Float

#fg3mFloat?

Returns 3-point field goals made

Examples:

stat.fg3m #=> 4.8

Returns:

  • (Float, nil)

    3-point field goals made



90
# File 'lib/nba/fantasy_profile_stat.rb', line 90

attribute :fg3m, Shale::Type::Float

#fg_pctFloat?

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.472

Returns:

  • (Float, nil)

    field goal percentage



98
# File 'lib/nba/fantasy_profile_stat.rb', line 98

attribute :fg_pct, Shale::Type::Float

#ft_pctFloat?

Returns free throw percentage

Examples:

stat.ft_pct #=> 0.908

Returns:

  • (Float, nil)

    free throw percentage



106
# File 'lib/nba/fantasy_profile_stat.rb', line 106

attribute :ft_pct, Shale::Type::Float

#nba_fantasy_ptsFloat?

Returns NBA Fantasy points

Examples:

stat.nba_fantasy_pts #=> 52.1

Returns:

  • (Float, nil)

    NBA Fantasy points



58
# File 'lib/nba/fantasy_profile_stat.rb', line 58

attribute :nba_fantasy_pts, Shale::Type::Float

#player_idInteger?

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer, nil)

    the player’s ID



18
# File 'lib/nba/fantasy_profile_stat.rb', line 18

attribute :player_id, Shale::Type::Integer

#player_nameString?

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String, nil)

    the player’s name



26
# File 'lib/nba/fantasy_profile_stat.rb', line 26

attribute :player_name, Shale::Type::String

#ptsFloat?

Returns points per game

Examples:

stat.pts #=> 26.4

Returns:

  • (Float, nil)

    points per game



66
# File 'lib/nba/fantasy_profile_stat.rb', line 66

attribute :pts, Shale::Type::Float

#rebFloat?

Returns rebounds per game

Examples:

stat.reb #=> 5.7

Returns:

  • (Float, nil)

    rebounds per game



74
# File 'lib/nba/fantasy_profile_stat.rb', line 74

attribute :reb, Shale::Type::Float

#stlFloat?

Returns steals per game

Examples:

stat.stl #=> 1.2

Returns:

  • (Float, nil)

    steals per game



114
# File 'lib/nba/fantasy_profile_stat.rb', line 114

attribute :stl, Shale::Type::Float

#team_abbreviationString?

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String, nil)

    the team’s abbreviation



42
# File 'lib/nba/fantasy_profile_stat.rb', line 42

attribute :team_abbreviation, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team’s ID



34
# File 'lib/nba/fantasy_profile_stat.rb', line 34

attribute :team_id, Shale::Type::Integer

#tovFloat?

Returns turnovers per game

Examples:

stat.tov #=> 3.1

Returns:

  • (Float, nil)

    turnovers per game



130
# File 'lib/nba/fantasy_profile_stat.rb', line 130

attribute :tov, Shale::Type::Float

Instance Method Details

#playerPlayer?

Returns the player

Examples:

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

Returns:

  • (Player, nil)

    the player object



138
139
140
# File 'lib/nba/fantasy_profile_stat.rb', line 138

def player
  Players.find(player_id)
end