Class: Hanami::Extensions::View::SliceConfiguredContext

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

Overview

Provides slice-specific configuration and behavior for any view context class defined within a slice’s module namespace.

Since:

  • 2.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slice) ⇒ SliceConfiguredContext

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 SliceConfiguredContext.

Since:

  • 2.1.0



16
17
18
19
# File 'lib/hanami/extensions/view/slice_configured_context.rb', line 16

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

Instance Attribute Details

#sliceObject (readonly)

Since:

  • 2.1.0



12
13
14
# File 'lib/hanami/extensions/view/slice_configured_context.rb', line 12

def slice
  @slice
end

Instance Method Details

#extended(_context_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.

Since:

  • 2.1.0



23
24
25
# File 'lib/hanami/extensions/view/slice_configured_context.rb', line 23

def extended(_context_class)
  define_new
end

#inspectObject

Since:

  • 2.1.0



29
30
31
# File 'lib/hanami/extensions/view/slice_configured_context.rb', line 29

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