All pastes #46660 Raw Edit

Unnamed

public ruby v1 · immutable
#46660 ·published 2006-03-22 23:09 UTC
rendered paste body
#!/bin/env ruby# $Id$# (c) 2006 Tony Collen <tcollen@halogenlabs.com>require 'game'require 'language_extensions'require 'rexml/document'include REXMLclass XBoxService  attr_accessor :url    def initialize(url = 'http://xbox.sierrabravo.net/xmlservice.php')    if url.nil?      raise ArgumentError, "Please specify a non-nil URL endpoint in the constructor."    else       @url = url    end  end    def get_games    Document.new(@url.fetch_as_url).to_games   end    def add_vote(game)    unless game.respond_to?(:to_vote_xml)      raise ArgumentError, "Object must respond to :to_vote_xml"    else       raise NotImplementedError    end  end  end