Module: Hanami::Extensions::Action::InstanceMethods
- Defined in:
- lib/hanami/extensions/action.rb
Overview
Instance methods for app-integrated actions.
Instance Attribute Summary collapse
-
#rack_monitor ⇒ Dry::Monitor::Rack::Middleware
readonly
Returns the app or slice’s ‘Dry::Monitor::Rack::Middleware` for use within action instance methods.
-
#routes ⇒ Hanami::Slice::RoutesHelper
readonly
Returns the app or slice’s RoutesHelper for use within action instance methods.
- #view ⇒ Object readonly private
- #view_context_class ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(routes: nil, **kwargs) ⇒ Object
Returns a new ‘Hanami::Action` with app components injected as dependencies.
Instance Attribute Details
#rack_monitor ⇒ Dry::Monitor::Rack::Middleware (readonly)
Returns the app or slice’s ‘Dry::Monitor::Rack::Middleware` for use within action instance methods.
61 62 63 |
# File 'lib/hanami/extensions/action.rb', line 61 def rack_monitor @rack_monitor end |
#routes ⇒ Hanami::Slice::RoutesHelper (readonly)
Returns the app or slice’s RoutesHelper for use within action instance methods.
52 53 54 |
# File 'lib/hanami/extensions/action.rb', line 52 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.
40 41 42 |
# File 'lib/hanami/extensions/action.rb', line 40 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.
43 44 45 |
# File 'lib/hanami/extensions/action.rb', line 43 def view_context_class @view_context_class end |
Instance Method Details
#initialize(routes: nil, **kwargs) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/hanami/extensions/action.rb', line 73 def initialize(view: nil, view_context_class: nil, rack_monitor: nil, routes: nil, **kwargs) @view = view @view_context_class = view_context_class @routes = routes @rack_monitor = rack_monitor super(**kwargs) end |