Class: MLB::Streak
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::Streak
- Defined in:
- lib/mlb/team_record.rb
Overview
Represents a team’s streak information
Constant Summary collapse
- WINS =
Winning streak type value
"wins".freeze
- LOSSES =
Losing streak type value
"losses".freeze
Instance Attribute Summary collapse
-
#streak_code ⇒ String
Returns the streak code.
-
#streak_number ⇒ Integer
Returns the streak length.
-
#streak_type ⇒ String
Returns the streak type.
Instance Method Summary collapse
-
#losing? ⇒ Boolean
Returns whether this is a losing streak.
-
#winning? ⇒ Boolean
Returns whether this is a winning streak.
Instance Attribute Details
#streak_code ⇒ String
Returns the streak code
49 |
# File 'lib/mlb/team_record.rb', line 49 attribute :streak_code, Shale::Type::String |
#streak_number ⇒ Integer
Returns the streak length
65 |
# File 'lib/mlb/team_record.rb', line 65 attribute :streak_number, Shale::Type::Integer |
#streak_type ⇒ String
Returns the streak type
57 |
# File 'lib/mlb/team_record.rb', line 57 attribute :streak_type, Shale::Type::String |
Instance Method Details
#losing? ⇒ Boolean
Returns whether this is a losing streak
86 |
# File 'lib/mlb/team_record.rb', line 86 def losing? = streak_type.eql?(LOSSES) |
#winning? ⇒ Boolean
Returns whether this is a winning streak
78 |
# File 'lib/mlb/team_record.rb', line 78 def winning? = streak_type.eql?(WINS) |