Class: MLB::LivePlays

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/mlb/live_feed.rb

Overview

Represents the plays section of the live feed

Instance Attribute Summary collapse

Instance Attribute Details

#all_playsArray<Play>

Returns all plays in the game

Examples:

plays.all_plays #=> [#<MLB::Play>, ...]

Returns:

  • (Array<Play>)

    all plays



16
# File 'lib/mlb/live_feed.rb', line 16

attribute :all_plays, Play, collection: true

#current_playPlay

Returns the current play

Examples:

plays.current_play #=> #<MLB::Play>

Returns:

  • (Play)

    the current play



24
# File 'lib/mlb/live_feed.rb', line 24

attribute :current_play, Play

#scoring_playsArray<Integer>

Returns indices of scoring plays

Examples:

plays.scoring_plays #=> [5, 12, 23]

Returns:

  • (Array<Integer>)

    scoring play indices



32
# File 'lib/mlb/live_feed.rb', line 32

attribute :scoring_plays, Shale::Type::Integer, collection: true