Sha256: c5d3dd268376a4630ea92529536f4750dedb46baa2f576a992de6979b25be20b

Contents?: true

Size: 1.29 KB

Versions: 13

Compression:

Stored size: 1.29 KB

Contents

# encoding: UTF-8
module ActionWebService # :nodoc:
  module Protocol # :nodoc:
    module Discovery # :nodoc:
      def self.included(base)
        base.extend(ClassMethods)
        base.send(:include, ActionWebService::Protocol::Discovery::InstanceMethods)
      end

      module ClassMethods # :nodoc:
        def register_protocol(klass)
          write_inheritable_array("web_service_protocols", [klass])
        end
      end

      module InstanceMethods # :nodoc:
        private
          def discover_web_service_request(action_pack_request)
            (self.class.read_inheritable_attribute("web_service_protocols") || []).each do |protocol|
              protocol = protocol.create(self)
              request = protocol.decode_action_pack_request(action_pack_request)
              return request unless request.nil?
            end
            nil
          end

          def create_web_service_client(api, protocol_name, endpoint_uri, options)
            (self.class.read_inheritable_attribute("web_service_protocols") || []).each do |protocol|
              protocol = protocol.create(self)
              client = protocol.protocol_client(api, protocol_name, endpoint_uri, options)
              return client unless client.nil?
            end
            nil
          end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
keeguon-actionwebservice-3.1.1 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.1.0 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.20 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.19 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.17.4 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.17.3 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.17.2 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.17.1 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.17 lib/action_web_service/protocol/discovery.rb
keeguon-actionwebservice-3.0.1 lib/action_web_service/protocol/discovery.rb
axtro-actionwebservice-2.3.5.1.20101118142125 lib/action_web_service/protocol/discovery.rb
rubyjedi-actionwebservice-2.3.5.20100714122544 lib/action_web_service/protocol/discovery.rb
rubyjedi-actionwebservice-2.3.5.20100618223219 lib/action_web_service/protocol/discovery.rb