Module: Hanami::Extensions::View::Part
- Defined in:
- lib/hanami/extensions/view/part.rb
Overview
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
- .included(part_class) ⇒ Object private
Instance Method Summary collapse
-
#helpers ⇒ Object
Returns an object including the default Hanami helpers as well as the user-defined helpers for the part’s slice.
Class Method Details
.included(part_class) ⇒ 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.
11 12 13 14 15 16 |
# File 'lib/hanami/extensions/view/part.rb', line 11 def self.included(part_class) super part_class.extend(Hanami::SliceConfigurable) part_class.extend(ClassMethods) end |
Instance Method Details
#helpers ⇒ Object
Returns an object including the default Hanami helpers as well as the user-defined helpers for the part’s slice.
Use this when you need to access helpers inside your part classes.
41 42 43 |
# File 'lib/hanami/extensions/view/part.rb', line 41 def helpers @helpers ||= self.class.const_get(:PartHelpers).new(context: _context) end |