Sha256: f86d25b56e005d3839ef37188870f224f77c4778b4fe254df37c38dcf378a865

Contents?: true

Size: 1.27 KB

Versions: 94

Compression:

Stored size: 1.27 KB

Contents

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

94 entries across 94 versions & 29 rubygems

Version Path
panztel-actionwebservice-2.3.4.a lib/action_web_service/protocol/discovery.rb
ywen-actionwebservice-2.3.4 lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb
actionwebservice-1.0.0 lib/action_web_service/protocol/discovery.rb
actionwebservice-0.9.3 lib/action_web_service/protocol/discovery.rb
actionwebservice-0.9.2 lib/action_web_service/protocol/discovery.rb
actionwebservice-1.1.1 lib/action_web_service/protocol/discovery.rb
actionwebservice-0.9.4 lib/action_web_service/protocol/discovery.rb
actionwebservice-0.9.1 lib/action_web_service/protocol/discovery.rb
actionwebservice-0.8.0 lib/action_web_service/protocol/discovery.rb
actionwebservice-1.1.0 lib/action_web_service/protocol/discovery.rb
actionwebservice-0.8.1 lib/action_web_service/protocol/discovery.rb
actionwebservice-1.2.3 lib/action_web_service/protocol/discovery.rb