Class: Gameday::Pitcher

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/gameday/pitcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(pitcher_data) ⇒ Pitcher

Returns a new instance of Pitcher.



11
12
13
# File 'lib/gameday/pitcher.rb', line 11

def initialize(pitcher_data)
  @pitcher = pitcher_data
end

Instance Method Details

#__getobj__Object

Sample “last”:“Blanton”,“name_display_roster”:“Blanton”,“number”:“56”,“era”:“4.87”,“id”:“430599”,“first_name”:“Joe”,“s_losses”:“6”,“s_era”:“4.87”,“last_name”:“Blanton”,“losses”:“6”,“first”:“Joe”,“s_wins”:“7”,“wins”:“7”



7
8
9
# File 'lib/gameday/pitcher.rb', line 7

def __getobj__
  @pitcher
end

#nameObject



15
16
17
# File 'lib/gameday/pitcher.rb', line 15

def name
  "#{self["first"]} #{self["last"]}"
end