Class: Hanami::Extensions::View::SliceConfiguredHelpers

Inherits:
Module
  • Object
show all
Defined in:
lib/hanami/extensions/view/slice_configured_helpers.rb

Overview

Provides slice-specific helper methods for any view object requiring access to helpers.

Since:

  • 2.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slice) ⇒ SliceConfiguredHelpers

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.

Returns a new instance of SliceConfiguredHelpers.

Since:

  • 2.1.0



15
16
17
18
# File 'lib/hanami/extensions/view/slice_configured_helpers.rb', line 15

def initialize(slice)
  super()
  @slice = slice
end

Instance Attribute Details

#sliceObject (readonly)

Since:

  • 2.1.0



11
12
13
# File 'lib/hanami/extensions/view/slice_configured_helpers.rb', line 11

def slice
  @slice
end

Instance Method Details

#extended(klass) ⇒ 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.

Since:

  • 2.1.0



22
23
24
# File 'lib/hanami/extensions/view/slice_configured_helpers.rb', line 22

def extended(klass)
  include_helpers(klass)
end

#inspectString

Returns:

  • (String)

Since:

  • 2.1.0



30
31
32
# File 'lib/hanami/extensions/view/slice_configured_helpers.rb', line 30

def inspect
  "#<#{self.class.name}[#{slice.name}]>"
end