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


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"


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

attribute :half_inning, Shale::Type::String

#inningInteger

Returns the inning number

Examples:

about.inning #=> 1


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


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


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


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


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


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


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

def top_inning?
  is_top_inning
end