Class: NBA::BoxScoreSimilarityStat

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

Overview

Represents a G League Alum box score similarity score

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#first_person_idInteger

Returns the first player ID

Examples:

stat.first_person_id #=> 201939

Returns:

  • (Integer)

    the first player ID



12
# File 'lib/nba/box_score_similarity_stat.rb', line 12

attribute :first_person_id, Shale::Type::Integer

#second_person_idInteger

Returns the second player ID

Examples:

stat.second_person_id #=> 203507

Returns:

  • (Integer)

    the second player ID



20
# File 'lib/nba/box_score_similarity_stat.rb', line 20

attribute :second_person_id, Shale::Type::Integer

#second_person_nameString

Returns the second player name

Examples:

stat.second_person_name #=> "Giannis Antetokounmpo"

Returns:

  • (String)

    the second player name



28
# File 'lib/nba/box_score_similarity_stat.rb', line 28

attribute :second_person_name, Shale::Type::String

#similarity_scoreFloat

Returns the similarity score between the two players

Examples:

stat.similarity_score #=> 0.85

Returns:

  • (Float)

    the similarity score



44
# File 'lib/nba/box_score_similarity_stat.rb', line 44

attribute :similarity_score, Shale::Type::Float

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612749

Returns:

  • (Integer)

    the team ID



36
# File 'lib/nba/box_score_similarity_stat.rb', line 36

attribute :team_id, Shale::Type::Integer

Instance Method Details

#first_personPlayer?

Returns the first player object

Examples:

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

Returns:

  • (Player, nil)

    the first player object



52
53
54
# File 'lib/nba/box_score_similarity_stat.rb', line 52

def first_person
  Players.find(first_person_id)
end

#second_personPlayer?

Returns the second player object

Examples:

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

Returns:

  • (Player, nil)

    the second player object



62
63
64
# File 'lib/nba/box_score_similarity_stat.rb', line 62

def second_person
  Players.find(second_person_id)
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



72
73
74
# File 'lib/nba/box_score_similarity_stat.rb', line 72

def team
  Teams.find(team_id)
end