Class: Hanami::Extensions::View::SliceConfiguredView

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

Overview

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

Since:

  • 2.1.0

Constant Summary collapse

TEMPLATES_DIR =

Since:

  • 2.1.0

"templates"
VIEWS_DIR =

Since:

  • 2.1.0

"views"
PARTS_DIR =

Since:

  • 2.1.0

"parts"
SCOPES_DIR =

Since:

  • 2.1.0

"scopes"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slice) ⇒ SliceConfiguredView

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

Since:

  • 2.1.0



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

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

Instance Attribute Details

#sliceObject (readonly)

Since:

  • 2.1.0



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

def slice
  @slice
end

Instance Method Details

#extended(view_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



28
29
30
31
32
# File 'lib/hanami/extensions/view/slice_configured_view.rb', line 28

def extended(view_class)
  load_app_view
  configure_view(view_class)
  define_inherited
end

#inspectString

Returns:

  • (String)

Since:

  • 2.1.0



38
39
40
# File 'lib/hanami/extensions/view/slice_configured_view.rb', line 38

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