Class: MLB::HighLow
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::HighLow
- Defined in:
- lib/mlb/high_low.rb
Overview
Provides methods for fetching high/low stats from the API
Instance Attribute Summary collapse
-
#high_low_results ⇒ Array<HighLowGroup>
Returns the high/low results.
Class Method Summary collapse
-
.find(org_type:, season: nil) ⇒ Array<HighLowResult>
Retrieves high/low stats for teams.
Instance Attribute Details
#high_low_results ⇒ Array<HighLowGroup>
Returns the high/low results
101 |
# File 'lib/mlb/high_low.rb', line 101 attribute :high_low_results, HighLowGroup, collection: true |
Class Method Details
.find(org_type:, season: nil) ⇒ Array<HighLowResult>
Retrieves high/low stats for teams
115 116 117 118 119 |
# File 'lib/mlb/high_low.rb', line 115 def self.find(org_type:, season: nil) season ||= Utils.current_season response = CLIENT.get("highLow/#{org_type}?#{Utils.build_query(season:)}") from_json(response).high_low_results.flat_map(&:splits) end |