Sha256: 39243982e5ae3ed9742f886bb292a5f9f332d2ee029b9018df987344587e45e6

Contents?: true

Size: 769 Bytes

Versions: 10

Compression:

Stored size: 769 Bytes

Contents

require 'rubygems'
require 'httparty'

$:.unshift(File.dirname(__FILE__))
require 'extensions/httparty'

module Barometer
  #
  # Web Service Class
  #
  # This is a base class for creating web service api-consuming
  # drivers.  Each driver inherits from this class.
  # 
  # Basically, all a service is required to do is take a query
  # (ie "Paris") and return it corresponding data class
  #
  class WebService
    # all web_service drivers will use the HTTParty gem
    include HTTParty
    
    # STUB: define this method to actually retireve the data
    def self.fetch(query=nil); raise NotImplementedError; end
    
    private
    
    def self._is_a_query?(object=nil)
      return false unless object
      object.is_a?(Barometer::Query)
    end

  end
end 

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
attack-barometer-0.5.0 lib/barometer/web_services/web_service.rb
attack-barometer-0.6.0 lib/barometer/web_services/web_service.rb
attack-barometer-0.6.1 lib/barometer/web_services/web_service.rb
barometer-0.6.7 lib/barometer/web_services/web_service.rb
barometer-0.6.6 lib/barometer/web_services/web_service.rb
barometer-0.6.4 lib/barometer/web_services/web_service.rb
barometer-0.6.1 lib/barometer/web_services/web_service.rb
barometer-0.6.3 lib/barometer/web_services/web_service.rb
barometer-0.5.0 lib/barometer/web_services/web_service.rb
barometer-0.6.2 lib/barometer/web_services/web_service.rb