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



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

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



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

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

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



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

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

#perform_invocation(method_name, params) ⇒ Object



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

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

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



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

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