Module: Hanami::Action::Glue Private
- Defined in:
- lib/hanami/action/glue.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Glue code for full stack Hanami applications
This includes missing rendering logic that it makes sense to include only for web applications.
Constant Summary collapse
- ENV_KEY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Rack environment key that indicates where the action instance is passed
'hanami.action'.freeze
- ADDITIONAL_HTTP_STATUSES_WITHOUT_BODY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Set.new([301, 302]).freeze
Class Method Summary collapse
-
.included(base) ⇒ Object
private
Override Ruby’s Module#included.
Instance Method Summary collapse
-
#renderable? ⇒ TrueClass, FalseClass
private
Check if the current HTTP request is renderable.
Class Method Details
.included(base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Override Ruby’s Module#included
25 26 27 |
# File 'lib/hanami/action/glue.rb', line 25 def self.included(base) base.class_eval { _expose(:format) if respond_to?(:_expose) } end |
Instance Method Details
#renderable? ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check if the current HTTP request is renderable.
It verifies if the verb isn’t HEAD, if the status demands to omit the body and if it isn’t sending a file.
38 39 40 41 42 |
# File 'lib/hanami/action/glue.rb', line 38 def renderable? !_requires_no_body? && !sending_file? && !ADDITIONAL_HTTP_STATUSES_WITHOUT_BODY.include?(@_status) end |