Class: Sportradar::Mlb::Models::PitchType
- Inherits:
-
Object
- Object
- Sportradar::Mlb::Models::PitchType
- Defined in:
- lib/sportradar/mlb/models/pitch_type.rb
Instance Method Summary collapse
-
#initialize(pitch_type:) ⇒ PitchType
constructor
A new instance of PitchType.
- #name ⇒ Object
- #pitch_info ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(pitch_type:) ⇒ PitchType
Returns a new instance of PitchType.
5 6 7 |
# File 'lib/sportradar/mlb/models/pitch_type.rb', line 5 def initialize(pitch_type:) @pitch_type = pitch_type end |
Instance Method Details
#name ⇒ Object
13 14 15 |
# File 'lib/sportradar/mlb/models/pitch_type.rb', line 13 def name pitch_info['type'] || '' end |
#pitch_info ⇒ Object
17 18 19 |
# File 'lib/sportradar/mlb/models/pitch_type.rb', line 17 def pitch_info pitch_types[pitch_type] || {} end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/sportradar/mlb/models/pitch_type.rb', line 9 def to_s name end |