Module: ActionWebService::Invocation::InstanceMethods

Defined in:
lib/action_web_service/invocation.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



128
129
130
131
132
# File 'lib/action_web_service/invocation.rb', line 128

def self.included(base)
  base.class_eval do
    alias_method_chain :perform_invocation, :interception
  end
end

Instance Method Details

#after_invocation(name, args, result) ⇒ Object



149
150
151
# File 'lib/action_web_service/invocation.rb', line 149

def after_invocation(name, args, result)
  call_interceptors(self.class.after_invocation_interceptors, [name, args, result])
end

#before_invocation(name, args, &block) ⇒ Object



145
146
147
# File 'lib/action_web_service/invocation.rb', line 145

def before_invocation(name, args, &block)
  call_interceptors(self.class.before_invocation_interceptors, [name, args], &block)
end

#perform_invocation(method_name, params) ⇒ Object



141
142
143
# File 'lib/action_web_service/invocation.rb', line 141

def perform_invocation(method_name, params)
  send(method_name, *params)
end

#perform_invocation_with_interception(method_name, params, &block) ⇒ Object



134
135
136
137
138
139
# File 'lib/action_web_service/invocation.rb', line 134

def perform_invocation_with_interception(method_name, params, &block)
  return if before_invocation(method_name, params, &block) == false
  return_value = perform_invocation_without_interception(method_name, params)
  after_invocation(method_name, params, return_value)
  return_value
end