class MLBGameday::Player
Attributes
data[R]
id[R]
Public Class Methods
new(id:, xml:)
click to toggle source
# File lib/mlb_gameday/player.rb, line 7 def initialize(id:, xml:) @id = id @data = xml end
Public Instance Methods
first_name()
click to toggle source
# File lib/mlb_gameday/player.rb, line 12 def first_name @data.xpath('//Player//@first_name').text end
last_name()
click to toggle source
# File lib/mlb_gameday/player.rb, line 16 def last_name @data.xpath('//Player//@last_name').text end
name()
click to toggle source
# File lib/mlb_gameday/player.rb, line 20 def name "#{first_name} #{last_name}" end