Class: NBA::VideoDetail

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

Overview

Represents a video detail for a play

API:

  • public

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionString

Returns the play description

Examples:

video.description #=> "Curry 3PT Jump Shot"

Returns:

  • the play description

API:

  • public



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

attribute :description, Shale::Type::String

#game_event_idInteger

Returns the game event ID

Examples:

video.game_event_id #=> 10

Returns:

  • the event ID

API:

  • public



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

attribute :game_event_id, Shale::Type::Integer

#game_idString

Returns the game ID

Examples:

video.game_id #=> "0022400001"

Returns:

  • the game ID

API:

  • public



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

attribute :game_id, Shale::Type::String

#player_idInteger

Returns the player ID

Examples:

video.player_id #=> 201939

Returns:

  • the player ID

API:

  • public



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

attribute :player_id, Shale::Type::Integer

#team_idInteger

Returns the team ID

Examples:

video.team_id #=> 1610612744

Returns:

  • the team ID

API:

  • public



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

attribute :team_id, Shale::Type::Integer

#video_availableInteger

Returns the video availability flag

Examples:

video.video_available #=> 1

Returns:

  • 1 if available, 0 if not

API:

  • public



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

attribute :video_available, Shale::Type::Integer

#video_idString

Returns the video ID

Examples:

video.video_id #=> "abc123"

Returns:

  • the video ID

API:

  • public



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

attribute :video_id, Shale::Type::String

#video_urlsString

Returns the video URLs

Examples:

video.video_urls #=> "{\"720p\": \"url1\", \"1080p\": \"url2\"}"

Returns:

  • the video URLs JSON string

API:

  • public



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

attribute :video_urls, Shale::Type::String

Instance Method Details

#available?Boolean

Returns whether the video is available

Examples:

video.available? #=> true

Returns:

  • true if video is available

API:

  • public



79
80
81
# File 'lib/nba/video_detail.rb', line 79

def available?
  video_available.eql?(1)
end

#playerPlayer?

Returns the player object for this video

Examples:

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

Returns:

  • the player object

API:

  • public



89
90
91
# File 'lib/nba/video_detail.rb', line 89

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team object for this video

Examples:

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

Returns:

  • the team object

API:

  • public



99
100
101
# File 'lib/nba/video_detail.rb', line 99

def team
  Teams.find(team_id)
end