Sha256: dd6960b96904fb083b97ed5e72075bda4565bab5267a1c19202ca0b0778e940f

Contents?: true

Size: 1.84 KB

Versions: 35

Compression:

Stored size: 1.84 KB

Contents

#
# Copyright (C) 2007 Mobio Networks, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

###
# This class uses class-based-instance variables to store a driver
# for each type of WSDL based webservice that needs to be accessed.
# :author   Nate Agrin
###

require 'soap/wsdlDriver'

module Rmobio
  module WebServices
    class WsdlDriver
      # class-level-instance variables
      # see http://wiseheartdesign.com/2006/9/22/class-level-instance-variables/
      @wsdl = nil
      @driver = nil
  
      # class level methods
      class << self
        attr_accessor :wsdl, :driver
        
        # sets the wsdl variable and attempts to create a SOAP::WSDLDriver object
        def wsdl=(wsdl)
          @wsdl = wsdl
          @driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
        end
      end
    
      # instance method for returning the underlying rpc_driver
      def driver
        self.class.driver
      end
      
      # instance method for returning the underlying wsdl address      
      def wsdl
        self.class.wsdl
      end
    
      # this may not be very useful because responses require interpertation
      def method_missing(method_id, *args)
        driver.send method_id, args if driver.respond_to?(method_id)
      end
    end
    
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rmobio-1.1.14 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.10 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.1 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.0 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.13 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.15 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.12 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.11 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.20 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.17 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.19 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.2 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.16 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.18 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.21 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.26 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.27 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.29 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.23 lib/rmobio/webservices/soap/drivers.rb
rmobio-1.1.24 lib/rmobio/webservices/soap/drivers.rb