Class: MLB::StreakCategory
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::StreakCategory
- Defined in:
- lib/mlb/streaks.rb
Overview
Represents a streaks category
Constant Summary collapse
- CATEGORY_HITTING =
"hittingStreak".freeze
- CATEGORY_ON_BASE =
"onBaseStreak".freeze
Instance Attribute Summary collapse
-
#category_type ⇒ String
Returns the streak category type.
-
#streaks ⇒ Array<PlayerStreak>
Returns the streaks.
Instance Method Summary collapse
-
#hitting_streak? ⇒ Boolean
Returns whether this is a hitting streak category.
-
#on_base_streak? ⇒ Boolean
Returns whether this is an on-base streak category.
Instance Attribute Details
#category_type ⇒ String
Returns the streak category type
98 |
# File 'lib/mlb/streaks.rb', line 98 attribute :category_type, Shale::Type::String |
#streaks ⇒ Array<PlayerStreak>
Returns the streaks
106 |
# File 'lib/mlb/streaks.rb', line 106 attribute :streaks, PlayerStreak, collection: true |
Instance Method Details
#hitting_streak? ⇒ Boolean
Returns whether this is a hitting streak category
114 |
# File 'lib/mlb/streaks.rb', line 114 def hitting_streak? = category_type.eql?(CATEGORY_HITTING) |
#on_base_streak? ⇒ Boolean
Returns whether this is an on-base streak category
122 |
# File 'lib/mlb/streaks.rb', line 122 def on_base_streak? = category_type.eql?(CATEGORY_ON_BASE) |