Module: Hanami::Extensions::Action::InstanceMethods
- Defined in:
- lib/hanami/extensions/action.rb
Overview
Instance methods for app-integrated actions.
Constant Summary collapse
- VIEW_RESERVED_KEYS =
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.
Options accepted by
Hanami::View#callitself, which must never be given from request params. %i[format context layout].freeze
Instance Attribute Summary collapse
-
#i18n ⇒ Hanami::Providers::I18n::Backend
readonly
Returns the slice's i18n backend.
-
#rack_monitor ⇒ Dry::Monitor::Rack::Middleware
readonly
Returns the slice's
Dry::Monitor::Rack::Middleware. -
#routes ⇒ Hanami::Slice::RoutesHelper
readonly
Returns the slice's RoutesHelper.
- #view ⇒ Object readonly private
- #view_context_class ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(routes: nil, **kwargs) ⇒ Object
Returns a new
Hanami::Actionwith app components injected as dependencies.
Instance Attribute Details
#i18n ⇒ Hanami::Providers::I18n::Backend (readonly)
Returns the slice's i18n backend.
74 75 76 |
# File 'lib/hanami/extensions/action.rb', line 74 def i18n @i18n end |
#rack_monitor ⇒ Dry::Monitor::Rack::Middleware (readonly)
Returns the slice's Dry::Monitor::Rack::Middleware.
66 67 68 |
# File 'lib/hanami/extensions/action.rb', line 66 def rack_monitor @rack_monitor end |
#routes ⇒ Hanami::Slice::RoutesHelper (readonly)
Returns the slice's RoutesHelper.
58 59 60 |
# File 'lib/hanami/extensions/action.rb', line 58 def routes @routes end |
#view ⇒ Object (readonly)
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.
47 48 49 |
# File 'lib/hanami/extensions/action.rb', line 47 def view @view end |
#view_context_class ⇒ Object (readonly)
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.
50 51 52 |
# File 'lib/hanami/extensions/action.rb', line 50 def view_context_class @view_context_class end |
Instance Method Details
#initialize(routes: nil, **kwargs) ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/hanami/extensions/action.rb', line 86 def initialize(view: nil, view_context_class: nil, rack_monitor: nil, routes: nil, i18n: nil, **kwargs) @view = view @view_context_class = view_context_class @routes = routes @rack_monitor = rack_monitor @i18n = i18n super(**kwargs) end |