Module: Jets::Controller::Compat::AbstractController::Base

Extended by:
ActiveSupport::Concern
Includes:
ActiveSupport::Configurable
Included in:
Base
Defined in:
lib/jets/controller/compat/abstract_controller/base.rb

Instance Method Summary collapse

Instance Method Details

#action_nameObject

Returns the name of the action this controller is processing.



76
77
78
# File 'lib/jets/controller/compat/abstract_controller/base.rb', line 76

def action_name
  @meth
end

#available_action?(action_name) ⇒ Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/jets/controller/compat/abstract_controller/base.rb', line 80

def available_action?(action_name)
  self.class.action_methods.include?(action_name.to_s)
end

#inspectObject

:nodoc:



95
96
97
# File 'lib/jets/controller/compat/abstract_controller/base.rb', line 95

def inspect # :nodoc:
  "#<#{self.class.name}:#{'%#016x' % (object_id << 1)}>"
end

#performed?Boolean

Tests if a response body is set. Used to determine if the process_action callback needs to be terminated in AbstractController::Callbacks.

Returns:

  • (Boolean)


87
88
89
90
91
92
93
# File 'lib/jets/controller/compat/abstract_controller/base.rb', line 87

def performed?
  if response_body.respond_to?(:each)
    !response_body.compact.empty? # [""] is considered true
  else # nil
    !response_body.nil?
  end
end

#response_bodyObject

Returns the body of the HTTP response sent by the controller.



72
# File 'lib/jets/controller/compat/abstract_controller/base.rb', line 72

attr_internal :response_body