Sha256: 502bcaa33d282de7c06da207fb387fb8b79ba2096b8eb00ff30eef753c400316
Contents?: true
Size: 657 Bytes
Versions: 22
Compression:
Stored size: 657 Bytes
Contents
module SportsDataApi module Ncaamb 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
22 entries across 22 versions & 1 rubygems