Module: ActionWebService::Dispatcher::ActionController

Defined in:
lib/action_web_service/dispatcher/action_controller_dispatcher.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods, Invocation, WsdlGeneration

Class Method Summary collapse

Class Method Details

.append_features(base) ⇒ Object

:nodoc:



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/action_web_service/dispatcher/action_controller_dispatcher.rb', line 4

def self.append_features(base) # :nodoc:
  super
  base.class_eval do
    class << self
      alias_method :inherited_without_action_controller, :inherited
    end
    alias_method :before_direct_invoke_without_action_controller, :before_direct_invoke
    alias_method :after_direct_invoke_without_action_controller, :after_direct_invoke
  end
  base.add_web_service_api_callback do |klass, api|
    if klass.web_service_dispatching_mode == :direct
      klass.class_eval <<-EOS
        def api
          controller_dispatch_web_service_request
        end
      EOS
    end
  end
  base.add_web_service_definition_callback do |klass, name, info|
    if klass.web_service_dispatching_mode == :delegated
      klass.class_eval <<-EOS
        def #{name}
          controller_dispatch_web_service_request
        end
      EOS
    end
  end
  base.extend(ClassMethods)
  base.send(:include, ActionWebService::Dispatcher::ActionController::Invocation)
end