Class: MLB::PlayAbout

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

Overview

Represents information about a play

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#at_bat_indexInteger

Returns the at bat index

Examples:

about.at_bat_index #=> 0

Returns:

  • (Integer)

    the at bat index



102
# File 'lib/mlb/play.rb', line 102

attribute :at_bat_index, Shale::Type::Integer

#half_inningString

Returns the half inning

Examples:

about.half_inning #=> "top"

Returns:

  • (String)

    the half inning



110
# File 'lib/mlb/play.rb', line 110

attribute :half_inning, Shale::Type::String

#inningInteger

Returns the inning number

Examples:

about.inning #=> 1

Returns:

  • (Integer)

    the inning



126
# File 'lib/mlb/play.rb', line 126

attribute :inning, Shale::Type::Integer

#is_completeBoolean

Returns whether the play is complete

Examples:

about.complete? #=> true

Returns:

  • (Boolean)

    whether complete



134
# File 'lib/mlb/play.rb', line 134

attribute :is_complete, Shale::Type::Boolean

#is_scoring_playBoolean

Returns whether this is a scoring play

Examples:

about.scoring_play? #=> false

Returns:

  • (Boolean)

    whether a scoring play



142
# File 'lib/mlb/play.rb', line 142

attribute :is_scoring_play, Shale::Type::Boolean

#is_top_inningBoolean

Returns whether it’s the top of the inning

Examples:

about.top_inning? #=> true

Returns:

  • (Boolean)

    whether top of inning



118
# File 'lib/mlb/play.rb', line 118

attribute :is_top_inning, Shale::Type::Boolean

Instance Method Details

#complete?Boolean

Returns whether the play is complete

Examples:

about.complete? #=> true

Returns:

  • (Boolean)

    whether complete



160
161
162
# File 'lib/mlb/play.rb', line 160

def complete?
  is_complete
end

#scoring_play?Boolean

Returns whether this is a scoring play

Examples:

about.scoring_play? #=> false

Returns:

  • (Boolean)

    whether a scoring play



170
171
172
# File 'lib/mlb/play.rb', line 170

def scoring_play?
  is_scoring_play
end

#top_inning?Boolean

Returns whether it’s the top of the inning

Examples:

about.top_inning? #=> true

Returns:

  • (Boolean)

    whether top of inning



150
151
152
# File 'lib/mlb/play.rb', line 150

def top_inning?
  is_top_inning
end