Sha256: c9e9b5818c8062e4f4fa3028e9d24853beb8719066d75886053707d8e548f6f5
Contents?: true
Size: 654 Bytes
Versions: 15
Compression:
Stored size: 654 Bytes
Contents
module SportsDataApi module Nba class Player attr_reader :stats def initialize(xml) if xml.is_a? Nokogiri::XML::Element player_ivar = self.instance_variable_set("@#{xml.name}", {}) self.class.class_eval { attr_reader :"#{xml.name}" } xml.attributes.each do | attr_name, attr_value| player_ivar[attr_name.to_sym] = attr_value.value end stats_xml = xml.xpath('statistics') if stats_xml.is_a? Nokogiri::XML::NodeSet and stats_xml.count > 0 @stats = SportsDataApi::Stats.new(stats_xml.first) end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems