Class: Sportradar::Mlb::Models::PitchType

Inherits:
Object
  • Object
show all
Defined in:
lib/sportradar/mlb/models/pitch_type.rb

Instance Method Summary collapse

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

#nameObject



13
14
15
# File 'lib/sportradar/mlb/models/pitch_type.rb', line 13

def name
  pitch_info['type'] || ''
end

#pitch_infoObject



17
18
19
# File 'lib/sportradar/mlb/models/pitch_type.rb', line 17

def pitch_info
  pitch_types[pitch_type] || {}
end

#to_sObject



9
10
11
# File 'lib/sportradar/mlb/models/pitch_type.rb', line 9

def to_s
  name
end