diff options
Diffstat (limited to 'actionwebservice/lib/action_web_service')
-rw-r--r-- | actionwebservice/lib/action_web_service/container/action_controller_container.rb | 16 | ||||
-rw-r--r-- | actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/actionwebservice/lib/action_web_service/container/action_controller_container.rb b/actionwebservice/lib/action_web_service/container/action_controller_container.rb index 06b47e9d79..d5afff09bb 100644 --- a/actionwebservice/lib/action_web_service/container/action_controller_container.rb +++ b/actionwebservice/lib/action_web_service/container/action_controller_container.rb @@ -2,13 +2,13 @@ module ActionWebService # :nodoc: module Container # :nodoc: module ActionController # :nodoc: def self.append_features(base) # :nodoc: - base.class_eval do - class << self - alias_method :inherited_without_api, :inherited - alias_method :web_service_api_without_require, :web_service_api - end + class << base + include ClassMethods + alias_method :inherited_without_api, :inherited + alias_method :inherited, :inherited_with_api + alias_method :web_service_api_without_require, :web_service_api + alias_method :web_service_api, :web_service_api_with_require end - base.extend(ClassMethods) end module ClassMethods @@ -43,7 +43,7 @@ module ActionWebService # :nodoc: end end - def web_service_api(definition=nil) # :nodoc: + def web_service_api_with_require(definition=nil) # :nodoc: return web_service_api_without_require if definition.nil? case definition when String, Symbol @@ -82,7 +82,7 @@ module ActionWebService # :nodoc: end private - def inherited(child) + def inherited_with_api(child) inherited_without_api(child) begin child.web_service_api(child.controller_path) rescue MissingSourceFile => e diff --git a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb index d3d74be289..d42851bf3b 100644 --- a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +++ b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb @@ -6,12 +6,12 @@ module ActionWebService # :nodoc: module ActionController # :nodoc: def self.append_features(base) # :nodoc: super - base.extend(ClassMethods) + class << base + include ClassMethods + alias_method :inherited_without_action_controller, :inherited + alias_method :inherited, :inherited_with_action_controller + end base.class_eval do - class << self - alias_method :inherited_without_action_controller, :inherited - alias_method :inherited, :inherited_with_action_controller - end alias_method :web_service_direct_invoke_without_controller, :web_service_direct_invoke end base.add_web_service_api_callback do |klass, api| |