Module: Reactive::Mvc::Controller::Output::InstanceMethods

Defined in:
lib/reactive-mvc/controller/output.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



220
221
222
223
224
# File 'lib/reactive-mvc/controller/output.rb', line 220

def self.included(base)
  base.class_eval do
    alias_method_chain :render, :output
  end
end

Instance Method Details

#active_output(passed_output = nil) ⇒ Object

Returns an output hash containing the name of the handler and the treatment to apply on output. If the output specs were specified as a method reference (through a symbol), this method is called and the return value is used. Likewise if the output specs were specified as an inline method (through a proc or method object).



229
230
231
232
233
234
235
236
# File 'lib/reactive-mvc/controller/output.rb', line 229

def active_output(passed_output = nil)
  output = passed_output || self.class.default_output(request.format, action_name)
  case output
    when Symbol then send(output)
    when Proc   then output.call(self)
    else output
  end
end