Module: ActionWebService::Dispatcher::ActionController

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

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, WsdlAction

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



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

def self.included(base) # :nodoc:
  class << base
    include ClassMethods
    alias_method_chain :inherited, :action_controller
  end
  base.class_eval do
    alias_method :web_service_direct_invoke_without_controller, :web_service_direct_invoke
  end
  base.add_web_service_api_callback do |klass, api|
    if klass.web_service_dispatching_mode == :direct
      klass.class_eval 'def api; dispatch_web_service_request; end'
    end
  end
  base.add_web_service_definition_callback do |klass, name, info|
    if klass.web_service_dispatching_mode == :delegated
      klass.class_eval "def #{name}; dispatch_web_service_request; end"
    elsif klass.web_service_dispatching_mode == :layered
      klass.class_eval 'def api; dispatch_web_service_request; end'
    end
  end
  base.send(:include, ActionWebService::Dispatcher::ActionController::InstanceMethods)
end